Module: Gemmy::Patches::ArrayPatch::InstanceMethods::Duplicates
- Defined in:
- lib/gemmy/patches/array_patch.rb
Instance Method Summary collapse
-
#duplicates(min = 2) ⇒ Object
facets.
Instance Method Details
#duplicates(min = 2) ⇒ Object
facets
49 50 51 52 53 54 55 |
# File 'lib/gemmy/patches/array_patch.rb', line 49 def duplicates(min=2) h = Hash.new( 0 ) each {|i| h[i] += 1 } h.delete_if{|_,v| v < min}.keys end |