Class: Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::HashValue
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::HashValue
- Defined in:
- lib/valkyrie/persistence/postgres/orm_converter.rb
Overview
Converts RDF::Literal typed-literals from JSON-LD stored into an
{RDF::Literal}
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
Instance Method Summary collapse
Methods inherited from ValueMapper
Constructor Details
This class inherits a constructor from Valkyrie::ValueMapper
Class Method Details
.handles?(value) ⇒ Boolean
65 66 67 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 65 def self.handles?(value) value.is_a?(Hash) && value["@value"] end |
Instance Method Details
#result ⇒ Object
69 70 71 72 73 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 69 def result RDF::Literal.new(value["@value"], language: value["@language"], datatype: value["@type"]) end |