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>)


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

def initialize(solr_rows)
  @solr_rows = solr_rows
end

Instance Attribute Details

#solr_rowsObject (readonly)

Returns the value of attribute solr_rows.



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

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


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

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