On Jun 20, 2012 5:57 PM, "Ryan Davis" <[email protected]> wrote:
>
>
>
>    counter = Hash.new 0
>    thingies.each do |o|
>      counter[o.key] += 1
>    end
>    return counter
>

I'm curious if you consider #each_with_object a reasonable choice for this.

--
Avdi

-- You received this message because you are subscribed to the Google Groups 
ruby-talk-google group. To post to this group, send email to 
[email protected]. To unsubscribe from this group, send email 
to [email protected]. For more options, visit this 
group at https://groups.google.com/d/forum/ruby-talk-google?hl=en

Reply via email to