Class: Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::IDValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::IDValue
- Defined in:
- lib/valkyrie/persistence/postgres/orm_converter.rb
Overview
Converts stored IDs into IDs
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a value is a Hash containing the key “id” (excluding those storing the Valkyrie Resource type).
Instance Method Summary collapse
-
#result ⇒ Valkyrie::ID
Constructs a Valkyrie::ID object using the String keyed to “id” in the 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 value is a Hash containing the key “id” (excluding those storing the Valkyrie Resource type)
136 137 138 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 136 def self.handles?(value) value.is_a?(Hash) && value["id"] && !value["internal_resource"] end |
Instance Method Details
#result ⇒ Valkyrie::ID
Constructs a Valkyrie::ID object using the String keyed to “id” in the value
142 143 144 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 142 def result Valkyrie::ID.new(value["id"]) end |