Class: PostApisAPIIDVersionsResponse404

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



20044
20045
20046
20047
20048
20049
20050
20051
# File 'lib/schemas.rb', line 20044

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

.from_json!(json) ⇒ Object



20053
20054
20055
# File 'lib/schemas.rb', line 20053

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

Instance Method Details

#to_dynamicObject



20057
20058
20059
20060
20061
20062
20063
# File 'lib/schemas.rb', line 20057

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

#to_json(options = nil) ⇒ Object



20065
20066
20067
# File 'lib/schemas.rb', line 20065

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