Class: Valkyrie::Persistence::Solr::ORMConverter::NestedResourceHash
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::NestedResourceHash
- Defined in:
- lib/valkyrie/persistence/solr/orm_converter.rb
Overview
Class for handling generic 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 a Hash.
Instance Method Summary collapse
-
#result ⇒ Hash
Constructs a Hash mapping each converted Solr field value to the existing keys in the Property Hash value.
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 a Hash
371 372 373 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 371 def self.handles?(value) value.is_a?(Hash) end |
Instance Method Details
#result ⇒ Hash
Constructs a Hash mapping each converted Solr field value to the existing keys in the Property Hash value
377 378 379 380 381 382 383 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 377 def result Hash[ value.map do |k, v| [k, calling_mapper.for(v).result] end ] end |