Class: PostCollectionsForkCollectionIDResponse

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



21810
21811
21812
21813
21814
21815
# File 'lib/schemas.rb', line 21810

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collection: d["collection"] ? PostCollectionsForkCollectionIDResponseCollection.from_dynamic!(d["collection"]) : nil,
  )
end

.from_json!(json) ⇒ Object



21817
21818
21819
# File 'lib/schemas.rb', line 21817

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

Instance Method Details

#to_dynamicObject



21821
21822
21823
21824
21825
# File 'lib/schemas.rb', line 21821

def to_dynamic
  {
    "collection" => collection&.to_dynamic,
  }
end

#to_json(options = nil) ⇒ Object



21827
21828
21829
# File 'lib/schemas.rb', line 21827

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