Class: PostApisResponse404

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



20375
20376
20377
20378
20379
20380
20381
20382
# File 'lib/schemas.rb', line 20375

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    detail:                     d["detail"],
    title:                      d["title"],
    post_apis_response404_type: d["type"],
  )
end

.from_json!(json) ⇒ Object



20384
20385
20386
# File 'lib/schemas.rb', line 20384

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

Instance Method Details

#to_dynamicObject



20388
20389
20390
20391
20392
20393
20394
# File 'lib/schemas.rb', line 20388

def to_dynamic
  {
    "detail" => detail,
    "title"  => title,
    "type"   => post_apis_response404_type,
  }
end

#to_json(options = nil) ⇒ Object



20396
20397
20398
# File 'lib/schemas.rb', line 20396

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