On Mon, Feb 11, 2013 at 9:15 AM, Javix <[email protected]> wrote:
>
>
> On Monday, February 11, 2013 3:46:46 PM UTC+1, Jordon Bedwell wrote:
>>
>> 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 = []
>> > => []
>>
> Yep, exact, 'select' works as needed. By the way, is there a way (I find no
> method neither in Rails API for Array nor in Ruby core library, to split an
> array in sub-arrays by month ?
date_array.chunk { |v| v.month }.map { |v| v.last }
--
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.