Class: DeleteMocksMockIDServerResponsesServerResponseIDResponseHeadersItem

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



2508
2509
2510
2511
2512
2513
2514
# File 'lib/schemas.rb', line 2508

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

.from_json!(json) ⇒ Object



2516
2517
2518
# File 'lib/schemas.rb', line 2516

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

Instance Method Details

#to_dynamicObject



2520
2521
2522
2523
2524
2525
# File 'lib/schemas.rb', line 2520

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

#to_json(options = nil) ⇒ Object



2527
2528
2529
# File 'lib/schemas.rb', line 2527

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