On Mon, Feb 11, 2013 at 8:33 AM, Javix <[email protected]> wrote: > I wonder why ruby core method 'take_while' does not work as expected in the > below Rails console example: > > irb(main):003:0> arr = [] > => []
Enumerable#take_while short-circuits on nil or false, hence the while in it's name. Use Enumerable#select -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

