On Sat, Nov 13, 2010 at 7:46 AM, Paul Roche <prpaulroche / gmail.com> wrote:

> I have a table called User which has a books_borrowed column. I'd like
> to stick to this lambda if at all possible :)
>
>
> borrowed =3D lambda do |x|
> =A0if x > 1 then p "you have borrowed too many"
> =A0else puts "you can borrow more"
> =A0end
> end

Wouldn't that just be:

  users =3D User.all
  users.each {|user| borrowed.call(user.books_borrowed)  }

?
--=20
Hassan Schroeder ------------------------ hassan.schroeder / gmail.com
twitter: @hassan