Class: Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata
- Inherits:
-
Object
- Object
- Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata
- Defined in:
- lib/valkyrie/persistence/postgres/orm_converter.rb
Overview
Responsible for converting ‘metadata` JSON-B field in Valkyrie::Persistence::Postgres::ORM::Resource into an acceptable hash for Resource
Defined Under Namespace
Classes: DateValue, EnumeratorValue, HashValue, IDValue, NestedRecord, PostgresValue, URIValue
Instance Attribute Summary collapse
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
-
#initialize(metadata) ⇒ RDFMetadata
constructor
A new instance of RDFMetadata.
- #result ⇒ Object
Constructor Details
#initialize(metadata) ⇒ RDFMetadata
Returns a new instance of RDFMetadata.
45 46 47 48 49 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 45 def initialize() # nil hash values are handled by the default state in dry-types # anyways, so don't bother processing them here. = .compact end |
Instance Attribute Details
#metadata ⇒ Object (readonly)
Returns the value of attribute metadata.
44 45 46 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 44 def end |
Instance Method Details
#result ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 51 def result Hash[ .map do |key, value| [key, PostgresValue.for(value).result] end ] end |