Class: PostCollectionsCollectionIDResponsesResponse500

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



21673
21674
21675
21676
21677
21678
21679
21680
# File 'lib/schemas.rb', line 21673

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

.from_json!(json) ⇒ Object



21682
21683
21684
# File 'lib/schemas.rb', line 21682

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

Instance Method Details

#to_dynamicObject



21686
21687
21688
21689
21690
21691
21692
# File 'lib/schemas.rb', line 21686

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

#to_json(options = nil) ⇒ Object



21694
21695
21696
# File 'lib/schemas.rb', line 21694

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