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

When `obj.extend(M)` is called, where does `M` actually get inserted, and what does the first part of `obj.singleton_class.ancestors` look like?

module M; def shout; "M"; end; end obj = Object.new obj.extend(M) p obj.singleton_class.ancestors.first(3)