Class: Valkyrie::Persistence::Solr::ORMConverter::NestedEnumerable
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::NestedEnumerable
- 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
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not an Object is an Array.
Instance Method Summary collapse
-
#result ⇒ Array<Hash>
Uses the NestedResourceConverter to parse each element in the enumerable value, mapping the converted attributes to each.
Methods inherited from ValueMapper
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
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
#result ⇒ Array<Hash>
Uses the NestedResourceConverter to parse each element in the enumerable value, mapping the converted attributes to each
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 |