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

When a method is defined in the same class as both an `include` and a later `prepend`, what is the resulting ancestor order and `super` chain?

module I; def f; "I->#{defined?(super) ? super : 'nil'}"; end; end module P; def f; "P->#{super}"; end; end class C include I def f; "C"; end prepend P end C.ancestors.take(4) # ? C.new.f # ?