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

A module is included into a class, instances are created, then the module is reopened to redefine and add methods. What do existing instances see?

module Mm; def v; "v1"; end; end class Cc; include Mm; end c = Cc.new module Mm; def v; "v2"; end; def w; "w"; end; end p [c.v, c.w]