Class: PostCollectionsForkCollectionIDResponse404ErrorDetails

Inherits:
Dry::Struct
  • Object
show all
Defined in:
lib/schemas.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.from_dynamic!(d) ⇒ Object



21897
21898
21899
21900
21901
21902
21903
# File 'lib/schemas.rb', line 21897

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    id:   d["id"],
    item: d["item"],
  )
end

.from_json!(json) ⇒ Object



21905
21906
21907
# File 'lib/schemas.rb', line 21905

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

Instance Method Details

#to_dynamicObject



21909
21910
21911
21912
21913
21914
# File 'lib/schemas.rb', line 21909

def to_dynamic
  {
    "id"   => id,
    "item" => item,
  }
end

#to_json(options = nil) ⇒ Object



21916
21917
21918
# File 'lib/schemas.rb', line 21916

def to_json(options = nil)
  JSON.generate(to_dynamic, options)
end