Class: DeleteCollectionsCollectionIDRequestsRequestIDResponse404ErrorDetails

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



1183
1184
1185
1186
1187
1188
1189
1190
# File 'lib/schemas.rb', line 1183

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



1192
1193
1194
# File 'lib/schemas.rb', line 1192

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

Instance Method Details

#to_dynamicObject



1196
1197
1198
1199
1200
1201
1202
# File 'lib/schemas.rb', line 1196

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

#to_json(options = nil) ⇒ Object



1204
1205
1206
# File 'lib/schemas.rb', line 1204

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