Class: PostCollectionsCollectionIDResponsesResponse401ErrorDetails

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



21574
21575
21576
21577
21578
21579
21580
21581
# File 'lib/schemas.rb', line 21574

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    model:    d["model"],
    model_id: d["model_id"],
    owner:    d["owner"],
  )
end

.from_json!(json) ⇒ Object



21583
21584
21585
# File 'lib/schemas.rb', line 21583

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

Instance Method Details

#to_dynamicObject



21587
21588
21589
21590
21591
21592
21593
# File 'lib/schemas.rb', line 21587

def to_dynamic
  {
    "model"    => model,
    "model_id" => model_id,
    "owner"    => owner,
  }
end

#to_json(options = nil) ⇒ Object



21595
21596
21597
# File 'lib/schemas.rb', line 21595

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