Create a lambda and then convert to a block with the &
operator:
isodd = lambda { |i| i % 2 == 1 }
[1,2,3,4].select(&isodd)
Create a lambda and then convert to a block with the &
operator:
isodd = lambda { |i| i % 2 == 1 }
[1,2,3,4].select(&isodd)