N
Neubyr Neubyr
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:
{{{=> 1
}}}
case 2:
{{{}}}
I am using Ruby on Mac OSX - ruby 1.8.7 (2009-06-12 patchlevel 174)
[universal-darwin10.0].
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:
{{{=> 1
}}}
case 2:
{{{}}}
I am using Ruby on Mac OSX - ruby 1.8.7 (2009-06-12 patchlevel 174)
[universal-darwin10.0].