Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyblocks procs lambdas bindingSingle-choice MCQ

When `define_method` is given a block, how does the resulting method treat `return`, and why does this differ from a method created with `def`?

class Z define_method(:m) { return 5; 10 } end p Z.new.m