Ruby - Modules and Mixins
Find the error in this Ruby code snippet:
module Sample
def self.greet
puts 'Hello'
end
end
include Sample
greetmodule Sample
def self.greet
puts 'Hello'
end
end
include Sample
greetgreet is a module method (defined with self.greet), not an instance method.greet is not available as a standalone method after include.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions