Ruby - Modules and Mixins
What will be the output of this Ruby code?
module M
def greet
"Hi"
end
end
class C
extend M
end
puts C.greetmodule M
def greet
"Hi"
end
end
class C
extend M
end
puts C.greetC.greet invokes M#greet, returning "Hi".15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions