Class: PostCollectionsCollectionIDRequestsResponse401ErrorDetails

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



21214
21215
21216
21217
21218
21219
21220
21221
# File 'lib/schemas.rb', line 21214

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



21223
21224
21225
# File 'lib/schemas.rb', line 21223

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

Instance Method Details

#to_dynamicObject



21227
21228
21229
21230
21231
21232
21233
# File 'lib/schemas.rb', line 21227

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

#to_json(options = nil) ⇒ Object



21235
21236
21237
# File 'lib/schemas.rb', line 21235

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