Class: PostCollectionsCollectionIDFoldersResponse400ErrorDetails

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



20735
20736
20737
20738
20739
20740
20741
20742
# File 'lib/schemas.rb', line 20735

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    model:    d["model"],
    model_id: d["model_id"],
    owner:    d["owner"],
  )
end

.from_json!(json) ⇒ Object



20744
20745
20746
# File 'lib/schemas.rb', line 20744

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

Instance Method Details

#to_dynamicObject



20748
20749
20750
20751
20752
20753
20754
# File 'lib/schemas.rb', line 20748

def to_dynamic
  {
    "model"    => model,
    "model_id" => model_id,
    "owner"    => owner,
  }
end

#to_json(options = nil) ⇒ Object



20756
20757
20758
# File 'lib/schemas.rb', line 20756

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