Class: PostMocksMockIDServerResponsesBodyServerResponseHeadersItem

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



24168
24169
24170
24171
24172
24173
24174
# File 'lib/schemas.rb', line 24168

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

.from_json!(json) ⇒ Object



24176
24177
24178
# File 'lib/schemas.rb', line 24176

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

Instance Method Details

#to_dynamicObject



24180
24181
24182
24183
24184
24185
# File 'lib/schemas.rb', line 24180

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

#to_json(options = nil) ⇒ Object



24187
24188
24189
# File 'lib/schemas.rb', line 24187

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