Method: Eternity::Index#apply

Defined in:
lib/eternity/index.rb

#apply(delta) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/eternity/index.rb', line 12

def apply(delta)
  delta.each do |collection, elements|
    elements.each do |id, change|
      args = [id, change['data']].compact
      self[collection].send change['action'], *args
    end
  end
end