Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubymethod lookup and ancestorsSingle-choice MCQ

An UnboundMethod taken from a parent class and bound to a subclass instance: which definition runs when the subclass overrides the method?

class Parent; def greet; "p"; end; end class Child < Parent; def greet; "c"; end; end bound = Parent.instance_method(:greet).bind(Child.new) puts bound.call