Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumRubydefine_methodSingle-choice MCQ

A method defined with define_method is then made private. What happens with a direct call versus send?

class Widget define_method(:secret_calc) { 42 } private :secret_calc end w = Widget.new w.secret_calc # (1) w.send(:secret_calc) # (2)