Class: Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::ValkyrieIDValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Fedora::Persister::OrmConverter::GraphToAttributes::ValkyrieIDValue
- Defined in:
- lib/valkyrie/persistence/fedora/persister/orm_converter.rb
Overview
Casts the value of the RDF literal into an Applicator for Valkyrie ID objects
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a Property statement is an RDF literal typed for Valkyrie ID literals.
Instance Method Summary collapse
-
#result ⇒ Applicator
Casts the value of the RDF literal into an Applicator for Valkyrie::ID objects.
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 statement is an RDF literal typed for Valkyrie ID literals
409 410 411 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 409 def self.handles?(value) value.statement.object.is_a?(RDF::Literal) && value.statement.object.datatype == PermissiveSchema.valkyrie_id end |
Instance Method Details
#result ⇒ Applicator
Casts the value of the RDF literal into an Applicator for Valkyrie::ID objects
415 416 417 418 |
# File 'lib/valkyrie/persistence/fedora/persister/orm_converter.rb', line 415 def result value.statement.object = Valkyrie::ID.new(value.statement.object.to_s) calling_mapper.for(Property.new(statement: value.statement, scope: value.scope, adapter: value.adapter)).result end |