Class: Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::NestedRecord
- Inherits:
-
ValueMapper
- Object
- ValueMapper
- Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata::NestedRecord
- Defined in:
- lib/valkyrie/persistence/postgres/orm_converter.rb
Overview
Converts nested records into Resources
Instance Attribute Summary
Attributes inherited from ValueMapper
Class Method Summary collapse
-
.handles?(value) ⇒ Boolean
Determines whether or not a value is a Hash containing multiple keys.
Instance Method Summary collapse
-
#result ⇒ Hash
Generates a Hash derived from the RDFMetadata for 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 multiple keys
172 173 174 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 172 def self.handles?(value) value.is_a?(Hash) && value.keys.length > 1 end |
Instance Method Details
#result ⇒ Hash
Generates a Hash derived from the RDFMetadata for the value
178 179 180 |
# File 'lib/valkyrie/persistence/postgres/orm_converter.rb', line 178 def result RDFMetadata.new(value).result.symbolize_keys end |