Class: PostCollectionsMergeResponse404ErrorDetails

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



22241
22242
22243
22244
22245
22246
22247
# File 'lib/schemas.rb', line 22241

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

.from_json!(json) ⇒ Object



22249
22250
22251
# File 'lib/schemas.rb', line 22249

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

Instance Method Details

#to_dynamicObject



22253
22254
22255
22256
22257
22258
# File 'lib/schemas.rb', line 22253

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

#to_json(options = nil) ⇒ Object



22260
22261
22262
# File 'lib/schemas.rb', line 22260

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