Class: GetMocksMockIDResponseMockConfig

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



11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
# File 'lib/schemas.rb', line 11134

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"],
    server_response_id: d["serverResponseId"],
  )
end

.from_json!(json) ⇒ Object



11145
11146
11147
# File 'lib/schemas.rb', line 11145

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

Instance Method Details

#to_dynamicObject



11149
11150
11151
11152
11153
11154
11155
11156
11157
# File 'lib/schemas.rb', line 11149

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

#to_json(options = nil) ⇒ Object



11159
11160
11161
# File 'lib/schemas.rb', line 11159

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