Class: Rod::ReferenceUpdater::PluralUpdater

Inherits:
Object
  • Object
show all
Defined in:
lib/rod/reference_updater.rb

Overview

Plural reference updater holds the collection proxy that includes the reference to be updated and its index within that collection.

Instance Method Summary collapse

Constructor Details

#initialize(database, collection, index) ⇒ PluralUpdater

Returns a new instance of PluralUpdater.



38
39
40
41
42
# File 'lib/rod/reference_updater.rb', line 38

def initialize(database,collection,index)
  @database = database
  @collection = collection
  @index = index
end

Instance Method Details

#update(object) ⇒ Object

Updates the id of the referenced object.



45
46
47
# File 'lib/rod/reference_updater.rb', line 45

def update(object)
  @collection.send(:update_reference_id,object.rod_id,@index)
end