Ruby - Modules and Mixins
How can you fix this code to allow calling
Greetings.say_hello?module Greetings
def say_hello
"Hello!"
end
endGreetings.say_hello?module Greetings
def say_hello
"Hello!"
end
endsay_hello is an instance method, so it cannot be called on the module directly.self. prefix makes it callable on the module itself.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions