Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyinclude prepend extendSingle-choice MCQ

When you call prepend on a module, how does MRI insert it into the ancestors chain relative to the including class, and what mechanism makes super inside the prepended module reach the original method?

module M; def run; "M->" + super; end; end class C; prepend M; def run; "C"; end; end p C.new.run