Class: Solr::Importer::ArrayMapper

Inherits:
Mapper
  • Object
show all
Defined in:
lib/solr/importer/array_mapper.rb

Instance Method Summary collapse

Methods inherited from Mapper

#field_data, #initialize, #mapped_field_value

Constructor Details

This class inherits a constructor from Solr::Importer::Mapper

Instance Method Details

#map(orig_data_array) ⇒ Object

TODO: make merge conflict handling configurable. as is, the last map fields win.



19
20
21
22
23
24
25
# File 'lib/solr/importer/array_mapper.rb', line 19

def map(orig_data_array)
  mapped_data = {}
  orig_data_array.each_with_index do |data,i|
    mapped_data.merge!(@mapping[i].map(data))
  end
  mapped_data
end