Class: PutMocksMockIDServerResponsesServerResponseIDBodyServerResponseHeadersItem

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



32868
32869
32870
32871
32872
32873
32874
# File 'lib/schemas.rb', line 32868

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    key:   d["key"],
    value: d["value"],
  )
end

.from_json!(json) ⇒ Object



32876
32877
32878
# File 'lib/schemas.rb', line 32876

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

Instance Method Details

#to_dynamicObject



32880
32881
32882
32883
32884
32885
# File 'lib/schemas.rb', line 32880

def to_dynamic
  {
    "key"   => key,
    "value" => value,
  }
end

#to_json(options = nil) ⇒ Object



32887
32888
32889
# File 'lib/schemas.rb', line 32887

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