Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardRubyProc vs lambda return and aritySingle-choice MCQ

For the three constructs below, what does `lambda?` report, in order: a method passed via `&` to a block-capturing method, a literal block, and a `Method` converted with `to_proc`?

def takes(&blk); blk.lambda?; end p takes(&->(x){}) p takes { } p "hi".method(:upcase).to_proc.lambda?