On Mon, Jan 21, 2013 at 11:21 AM, Rob Biedenharn
wrote:
> I tend to use a method like:
>
> module Enumerable
> # Returns a Hash keyed by the value of the block to the number times that
> # value was returned. If you have experience with the #group_by from
> # ActiveSupport, this would be li
I tend to use a method like:
module Enumerable
# Returns a Hash keyed by the value of the block to the number times that
# value was returned. If you have experience with the #group_by from
# ActiveSupport, this would be like .group_by(&block).map{|k,a|[k,a.size]}
# (except it is a Hash r
thanks :)
On Mon, Jan 21, 2013 at 12:06 PM, bala kishore pulicherla <
balumc...@gmail.com> wrote:
> a.count("casual")
--
*"Attitude is a little thing that makes a big difference"*
Thanks & Regards
*Ashokkumar.Y*
*ROR-Developer
**email : ashokku...@shriramits.com*
*Shriramits*
*
*
--
Y
we can use a.count("casual") and viceversa.
On Mon, Jan 21, 2013 at 12:03 PM, Maddy wrote:
> Hi Everyone,
>
> Good Day,
>
> a=[ 'casual','sick','casual','sick','casual','sick','casual','sick' ]
>
> I need to collect casual's count and sick's count like,
> Caual :4
> Sick :4
>
> Thank you,
>
> -
Hi Everyone,
Good Day,
a=[ 'casual','sick','casual','sick','casual','sick','casual','sick' ]
I need to collect casual's count and sick's count like,
Caual :4
Sick :4
Thank you,
--
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post
5 matches
Mail list logo