Ruby - Modules and Mixins
Identify the error in this Ruby module method code:
module Greetings
def greet
"Hello!"
end
end
puts Greetings.greetmodule Greetings
def greet
"Hello!"
end
end
puts Greetings.greetgreet is defined without self., so it is an instance method, not a module method.Greetings.greet tries to call a module method, but none exists, causing an error.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions