Method: Hash#count
- Defined in:
- lib/core/facets/hash/count.rb
#count(*value) ⇒ Object
Like Enumerable#count, but can count hash values.
{:A=>1, :B=>1}.count(1) #=> 2
7 8 9 10 11 12 13 |
# File 'lib/core/facets/hash/count.rb', line 7 def count(*value) if value.empty? super() else values.count(*value) end end |