Class: GetCollectionsCollectionIDResponse

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



8033
8034
8035
8036
8037
8038
# File 'lib/schemas.rb', line 8033

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

.from_json!(json) ⇒ Object



8040
8041
8042
# File 'lib/schemas.rb', line 8040

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

Instance Method Details

#to_dynamicObject



8044
8045
8046
8047
8048
# File 'lib/schemas.rb', line 8044

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

#to_json(options = nil) ⇒ Object



8050
8051
8052
# File 'lib/schemas.rb', line 8050

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