Class: GetCollectionsResponse

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



9054
9055
9056
9057
9058
9059
# File 'lib/schemas.rb', line 9054

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    collections: d["collections"]&.map { |x| GetCollectionsResponseCollectionsItem.from_dynamic!(x) },
  )
end

.from_json!(json) ⇒ Object



9061
9062
9063
# File 'lib/schemas.rb', line 9061

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

Instance Method Details

#to_dynamicObject



9065
9066
9067
9068
9069
# File 'lib/schemas.rb', line 9065

def to_dynamic
  {
    "collections" => collections&.map { |x| x.to_dynamic },
  }
end

#to_json(options = nil) ⇒ Object



9071
9072
9073
# File 'lib/schemas.rb', line 9071

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