Class: Valkyrie::Persistence::Solr::ModelConverter::EnumerableValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ModelConverter::EnumerableValue
- Defined in:
- lib/valkyrie/persistence/solr/model_converter.rb
Overview
Casts enumerable values one by one.
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a Property value is an Array.
Instance Method Summary collapse
-
#result ⇒ CompositeSolrRow
Constructs a CompositeSolrRow object for a set of Property values.
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
Determines whether or not a Property value is an Array
256 257 258 |
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 256 def self.handles?(value) value.is_a?(Property) && value.value.is_a?(Array) end |
Instance Method Details
#result ⇒ CompositeSolrRow
Constructs a CompositeSolrRow object for a set of Property values
262 263 264 265 266 267 268 |
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 262 def result CompositeSolrRow.new( value.value.map do |val| calling_mapper.for(Property.new(value.key, val, value.value)).result end ) end |