Top Level Namespace

Defined Under Namespace

Modules: WindClutter

Instance Method Summary collapse

Instance Method Details

#collect(collection, key, value) ⇒ Object



3
4
5
6
# File 'lib/windclutter/util/collector.rb', line 3

def collect(collection, key, value)
  collection[key] ||= 0
  collection[key] = collection[key] + value
end

#sorter(collection) ⇒ Object



3
4
5
# File 'lib/windclutter/util/sorter.rb', line 3

def sorter(collection)
  collection.sort_by { |_, v| -v }
end