Class: PostCollectionsForkCollectionIDResponseCollection

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



21777
21778
21779
21780
21781
21782
21783
21784
21785
# File 'lib/schemas.rb', line 21777

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    post_collections_fork_collection_id_response_collection_fork: d["fork"] ? PostCollectionsForkCollectionIDResponseCollectionFork.from_dynamic!(d["fork"]) : nil,
    id:                                                           d["id"],
    post_collections_fork_collection_id_response_collection_name: d["name"],
    uid:                                                          d["uid"],
  )
end

.from_json!(json) ⇒ Object



21787
21788
21789
# File 'lib/schemas.rb', line 21787

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

Instance Method Details

#to_dynamicObject



21791
21792
21793
21794
21795
21796
21797
21798
# File 'lib/schemas.rb', line 21791

def to_dynamic
  {
    "fork" => post_collections_fork_collection_id_response_collection_fork&.to_dynamic,
    "id"   => id,
    "name" => post_collections_fork_collection_id_response_collection_name,
    "uid"  => uid,
  }
end

#to_json(options = nil) ⇒ Object



21800
21801
21802
# File 'lib/schemas.rb', line 21800

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