Class: Valkyrie::Persistence::Solr::ORMConverter::NestedResourceLiteral
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Solr::ORMConverter::NestedResourceLiteral
- Defined in:
- lib/valkyrie/persistence/solr/orm_converter.rb
Overview
Class for handling serialized Hashes for RDF literals 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 with a string mapped to the “@value” key.
Instance Method Summary collapse
-
#result ⇒ RDF::URI
Constructs a RDF::Literal object using the value keyed to :@value and language tag keyed to :@language 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
Note:
this is used to determine whether or not this is a RDF literal for an attribute
Determines whether or not an Object is a Hash with a string mapped to the “@value” key
353 354 355 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 353 def self.handles?(value) value.is_a?(Hash) && value[:@value] end |
Instance Method Details
#result ⇒ RDF::URI
Constructs a RDF::Literal object using the value keyed to :@value and language tag keyed to :@language in the Property Hash value
359 360 361 |
# File 'lib/valkyrie/persistence/solr/orm_converter.rb', line 359 def result RDF::Literal.new(value[:@value], language: value[:@language]) end |