Class: Cocina::Models::DRO

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/cocina/models/dro.rb

Overview

Class Method Summary collapse

Class Method Details

.from_dynamic(d) ⇒ Object



13
14
15
16
17
18
19
# File 'lib/cocina/models/dro.rb', line 13

def self.from_dynamic(d)
  DRO.new(
    externalIdentifier: d['externalIdentifier'],
    type: d['type'],
    label: d['label']
  )
end

.from_json(json) ⇒ Object



21
22
23
# File 'lib/cocina/models/dro.rb', line 21

def self.from_json(json)
  from_dynamic(JSON.parse(json))
end