Class: Valkyrie::Persistence::Solr::ModelConverter::IDPropertyValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ModelConverter::IDPropertyValue
- Defined in:
- lib/valkyrie/persistence/solr/model_converter.rb
Overview
Casts ID values into a recognizable string in solr.
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a Property value is a Valkyrie ID.
Instance Method Summary collapse
-
#result ⇒ SolrRow
Constructs a SolrRow object for the Property Valkyrie ID 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 a Property value is a Valkyrie ID
278 279 280 |
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 278 def self.handles?(value) value.is_a?(Property) && value.value.is_a?(::Valkyrie::ID) end |
Instance Method Details
#result ⇒ SolrRow
Note:
this prepends the string “id-” to the value indexed in Solr
Constructs a SolrRow object for the Property Valkyrie ID value
285 286 287 |
# File 'lib/valkyrie/persistence/solr/model_converter.rb', line 285 def result calling_mapper.for(Property.new(value.key, "id-#{value.value.id}")).result end |