I am learning Ruby and having some difficulty understanding blocks. I
was trying out following code for getting better idea about blocks. I
was expecting case 2 to print 'test' string, but it is not printing
out anything. Any elaboration on what's happening here would be really
helpful.

case 1:
{{{
>> num1 = 1.22
=> 1.22
>> num1.round {|a| puts a}
=> 1
}}}

case 2:
{{{
>> num1 = 1.22
=> 1.22
>> num1.round {|a| puts "test"}
=> 1
>>
}}}

I am using Ruby on Mac OSX - ruby 1.8.7 (2009-06-12 patchlevel 174)
[universal-darwin10.0].

--
neuby.r

-- 
Posted via http://www.ruby-forum.com/.