Class: PostApisAPIIDSchemasResponse404

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



19802
19803
19804
19805
19806
19807
19808
19809
# File 'lib/schemas.rb', line 19802

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

.from_json!(json) ⇒ Object



19811
19812
19813
# File 'lib/schemas.rb', line 19811

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

Instance Method Details

#to_dynamicObject



19815
19816
19817
19818
19819
19820
19821
# File 'lib/schemas.rb', line 19815

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

#to_json(options = nil) ⇒ Object



19823
19824
19825
# File 'lib/schemas.rb', line 19823

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