Class: Rod::ReferenceUpdater::IndexUpdater
- Inherits:
-
Object
- Object
- Rod::ReferenceUpdater::IndexUpdater
- Defined in:
- lib/rod/reference_updater.rb
Overview
This updater is used when there is an index of Rod objects and one of its keys is an object which is not yet stored. The key of the index is set to the rod_id, when the object is stored.
Instance Method Summary collapse
-
#initialize(index) ⇒ IndexUpdater
constructor
The updater is initialized with the
index
to be updated. -
#update(object) ⇒ Object
Updates the index by providing the object with the updated
rod_id
.
Constructor Details
#initialize(index) ⇒ IndexUpdater
The updater is initialized with the index
to be updated.
56 57 58 |
# File 'lib/rod/reference_updater.rb', line 56 def initialize(index) @index = index end |
Instance Method Details
#update(object) ⇒ Object
Updates the index by providing the object with the updated rod_id
.
61 62 63 |
# File 'lib/rod/reference_updater.rb', line 61 def update(object) @index.key_persisted(object) end |