Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyinclude prepend extend on the chainSingle-choice MCQ

What is `C.new.greet`, and why does `super` inside the prepended module resolve to `C#greet`?

module M def greet; "M:" + super; end end class C prepend M def greet; "C"; end end puts C.ancestors.inspect # [M, C, Object, Kernel, BasicObject] puts C.new.greet