From: Gregory Brown Date: 2007-07-04T09:20:13+09:00 Subject: Re: Using a block to surround a string? small correction... On 7/3/07, Gregory Brown wrote: > On 7/3/07, Matt Greer wrote: > Here's a set of examples all rolled together for that: > > def foo > a = 1 > yield(a) > puts "a in method #{a}" > end > > b = 3 > > puts "b before block: #{b}" > > foo { |a| b += 2; a += 1; puts "a in block: #{a}" } > puts "b after block: #{b}" > OUTPUTS: > > b before block: 3 > a in block: 2 > a in method 1 > b after block: 5