Class: Rod::ReferenceUpdater::PluralUpdater
- Inherits:
-
Object
- Object
- Rod::ReferenceUpdater::PluralUpdater
- 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
-
#initialize(database, collection, index) ⇒ PluralUpdater
constructor
A new instance of PluralUpdater.
-
#update(object) ⇒ Object
Updates the id of the referenced
object
.
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 |