Ruby - Metaprogramming Fundamentals
Which of the following is the correct syntax to define a method
hello inside a class created with Class.new?hello inside a class created with Class.new?do...end block with method definition inside is valid.def method_name() ... end or def method_name; ... end. MyClass = Class.new do def hello() 'Hi' end end uses parentheses and block correctly.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions