Is it possible for a lambda
, proc
, method
or other type of block in ruby, to yield to another block?
something like...
a = lambda {
puts 'in a'
yield if block_given?
}
a.call { puts "in a's block" }
this doesn't work... it just produces
in a
=> nil
Is there way to get the block to call a block?