The problem you're having is that your block returns the result of the puts
, which is nil
, and in a string winds up being an empty string. use a different block, for example this, and you get a different result:
puts bi.yield_madness(12, 24) { |x, y|
puts "x: #{x} and y: #{y}"
32
}
x: 80.2547770700637 and y: 12
my_funky_pi: 80.2547770700637
my_yield: 32
=> nil