Class: PutMocksMockIDResponseMockConfig

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



32527
32528
32529
32530
32531
32532
32533
32534
32535
# File 'lib/schemas.rb', line 32527

def self.from_dynamic!(d)
  d = Types::Hash[d]
  new(
    headers:            d["headers"],
    match_body:         d["matchBody"],
    match_query_params: d["matchQueryParams"],
    match_wildcards:    d["matchWildcards"],
  )
end

.from_json!(json) ⇒ Object



32537
32538
32539
# File 'lib/schemas.rb', line 32537

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

Instance Method Details

#to_dynamicObject



32541
32542
32543
32544
32545
32546
32547
32548
# File 'lib/schemas.rb', line 32541

def to_dynamic
  {
    "headers"          => headers,
    "matchBody"        => match_body,
    "matchQueryParams" => match_query_params,
    "matchWildcards"   => match_wildcards,
  }
end

#to_json(options = nil) ⇒ Object



32550
32551
32552
# File 'lib/schemas.rb', line 32550

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