Module: Trackman::Components::Shippable

Included in:
Assets::Asset
Defined in:
lib/trackman/components/shippable.rb

Instance Method Summary collapse

Instance Method Details

#ship(diff) ⇒ Object



4
5
6
7
8
9
10
11
12
# File 'lib/trackman/components/shippable.rb', line 4

def ship diff
  to_ship = diff.inject([])do |memo, (k, v)| 
    memo + v.map{ |x| {:proc => build_proc(k, x), :value => x} }
  end
  
  to_ship.sort_by{ |x| x[:value] }.each do |x| 
    x[:proc].call
  end 
end