Class: Valkyrie::Persistence::Solr::ORMConverter::NestedEnumerable

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

Overview

Class for handling multiple serialized Hashes in Solr fields

Instance Attribute Summary

Attributes inherited from ValueMapper

#calling_mapper, #value

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ValueMapper

for, #initialize, register

Constructor Details

This class inherits a constructor from Valkyrie::ValueMapper

Class Method Details

.handles?(value) ⇒ Boolean

Determines whether or not an Object is an Array

Parameters:

  • value (Object)

Returns:

  • (Boolean)


295
296
297
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 295

def self.handles?(value)
  value.is_a?(Array)
end

Instance Method Details

#resultArray<Hash>

Uses the NestedResourceConverter to parse each element in the enumerable value, mapping the converted attributes to each

Returns:

  • (Array<Hash>)


301
302
303
304
305
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 301

def result
  value.map do |v|
    calling_mapper.for(v).result
  end
end