Class: Valkyrie::Persistence::Solr::ModelConverter::CompositeSolrRow

Inherits:
Object
  • Object
show all
Defined in:
lib/valkyrie/persistence/solr/model_converter.rb

Overview

Wraps up multiple SolrRows to apply them all at once, while looking like just one.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(solr_rows) ⇒ CompositeSolrRow

Returns a new instance of CompositeSolrRow.

Parameters:

  • solr_rows (Array<Valkyrie::Persistence::Solr::Mapper::SolrRow>)

188
189
190
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 188

def initialize(solr_rows)
  @solr_rows = solr_rows
end

Instance Attribute Details

#solr_rowsObject (readonly)

Returns the value of attribute solr_rows


185
186
187
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 185

def solr_rows
  @solr_rows
end

Instance Method Details

#apply_to(hsh) ⇒ Object

Merge a Hash of attribute values into a logical row of Solr fields

Parameters:

  • hsh (Hash)

See Also:

  • Valkyrie::Persistence::Solr::Mapper::SolrRow#apply_to

195
196
197
198
199
200
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 195

def apply_to(hsh)
  solr_rows.each do |solr_row|
    solr_row.apply_to(hsh)
  end
  hsh
end