Class: Valkyrie::Persistence::Postgres::ORMConverter::RDFMetadata

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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

#metadataObject (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

#resultObject



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