Class: Dionysus::Consumer::SyncedData::AssignColumnsFromSyncedData

Inherits:
Object
  • Object
show all
Defined in:
lib/dionysus/consumer/synced_data/assign_columns_from_synced_data.rb

Instance Method Summary collapse

Constructor Details

#initialize(config: Dionysus::Consumer.configuration) ⇒ AssignColumnsFromSyncedData

Returns a new instance of AssignColumnsFromSyncedData.



7
8
9
# File 'lib/dionysus/consumer/synced_data/assign_columns_from_synced_data.rb', line 7

def initialize(config: Dionysus::Consumer.configuration)
  @config = config
end

Instance Method Details

#call(collection, columns) ⇒ Object



11
12
13
# File 'lib/dionysus/consumer/synced_data/assign_columns_from_synced_data.rb', line 11

def call(collection, columns)
  collection.each { |record| record.update!(hash_of_attributes(record, columns)) }
end