Class: Valkyrie::Persistence::Fedora::Persister::ModelConverter::EnumerableValue
- Inherits:
-
MappedFedoraValue
- Object
- ValueMapper
- MappedFedoraValue
- Valkyrie::Persistence::Fedora::Persister::ModelConverter::EnumerableValue
- Defined in:
- lib/valkyrie/persistence/fedora/persister/model_converter.rb
Overview
Class mapping Property objects for value arrays
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for Array values.
Instance Method Summary collapse
-
#result ⇒ CompositeProperty
Construct a CompositeProperty composed of the mapped Array elements.
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
Determines whether or not the value is a Property for Array values
528 529 530 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 528 def self.handles?(value) value.is_a?(Property) && value.value.is_a?(Array) end |
Instance Method Details
#result ⇒ CompositeProperty
Construct a CompositeProperty composed of the mapped Array elements
534 535 536 537 538 539 |
# File 'lib/valkyrie/persistence/fedora/persister/model_converter.rb', line 534 def result new_values = value.value.map do |val| map_value(converted_value: val) end CompositeProperty.new(new_values) end |