Module: DeltaCore::Strategies::Base
- Defined in:
- lib/delta_core/strategies/base.rb
Class Method Summary collapse
- .call(_snapshot_collection, _current_collection, _mapping) ⇒ Object
- .index_by_key(collection, key) ⇒ Object
Class Method Details
.call(_snapshot_collection, _current_collection, _mapping) ⇒ Object
6 7 8 |
# File 'lib/delta_core/strategies/base.rb', line 6 def self.call(_snapshot_collection, _current_collection, _mapping) raise NotImplementedError, "#{name} must implement .call" end |
.index_by_key(collection, key) ⇒ Object
10 11 12 13 14 |
# File 'lib/delta_core/strategies/base.rb', line 10 def self.index_by_key(collection, key) collection.each_with_object({}) do |entity, idx| idx[entity[key]] = entity end end |