Class: Valkyrie::Persistence::Solr::ModelConverter::EnumerableValue

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

Overview

Casts enumerable values one by one.

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

Returns:

  • (Boolean)


160
161
162
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 160

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

Instance Method Details

#resultObject



164
165
166
167
168
169
170
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 164

def result
  CompositeSolrRow.new(
    value.value.map do |val|
      calling_mapper.for(Property.new(value.key, val, value.value)).result
    end
  )
end