Class: UpdatePanCollectionCollectionEnvironments

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



36843
36844
36845
36846
36847
36848
36849
# File 'lib/schemas.rb', line 36843

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    add:    d["$add"],
    remove: d["$remove"],
  )
end

.from_json!(json) ⇒ Object



36851
36852
36853
# File 'lib/schemas.rb', line 36851

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

Instance Method Details

#to_dynamicObject



36855
36856
36857
36858
36859
36860
# File 'lib/schemas.rb', line 36855

def to_dynamic
  {
    "$add"    => add,
    "$remove" => remove,
  }
end

#to_json(options = nil) ⇒ Object



36862
36863
36864
# File 'lib/schemas.rb', line 36862

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