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

What does prepending a module onto an individual object's singleton class do to that object's method lookup?

class Widget def name; "base"; end end w = Widget.new module Decor; def name; "decor->" + super; end; end w.singleton_class.prepend(Decor) p w.name