Class: MockServer::VerificationSequence
- Inherits:
-
Object
- Object
- MockServer::VerificationSequence
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#expectation_ids ⇒ Object
Returns the value of attribute expectation_ids.
-
#http_requests ⇒ Object
Returns the value of attribute http_requests.
-
#http_responses ⇒ Object
Returns the value of attribute http_responses.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_requests: nil, http_responses: nil, expectation_ids: nil) ⇒ VerificationSequence
constructor
A new instance of VerificationSequence.
- #to_h ⇒ Object
Constructor Details
#initialize(http_requests: nil, http_responses: nil, expectation_ids: nil) ⇒ VerificationSequence
Returns a new instance of VerificationSequence.
2213 2214 2215 2216 2217 |
# File 'lib/mockserver/models.rb', line 2213 def initialize(http_requests: nil, http_responses: nil, expectation_ids: nil) @http_requests = http_requests @http_responses = http_responses @expectation_ids = expectation_ids end |
Instance Attribute Details
#expectation_ids ⇒ Object
Returns the value of attribute expectation_ids.
2211 2212 2213 |
# File 'lib/mockserver/models.rb', line 2211 def expectation_ids @expectation_ids end |
#http_requests ⇒ Object
Returns the value of attribute http_requests.
2211 2212 2213 |
# File 'lib/mockserver/models.rb', line 2211 def http_requests @http_requests end |
#http_responses ⇒ Object
Returns the value of attribute http_responses.
2211 2212 2213 |
# File 'lib/mockserver/models.rb', line 2211 def http_responses @http_responses end |
Class Method Details
.from_hash(data) ⇒ Object
2227 2228 2229 2230 2231 2232 2233 2234 2235 2236 2237 2238 |
# File 'lib/mockserver/models.rb', line 2227 def self.from_hash(data) return nil if data.nil? http_requests_data = data['httpRequests'] http_responses_data = data['httpResponses'] expectation_ids_data = data['expectationIds'] new( http_requests: http_requests_data&.map { |r| HttpRequest.from_hash(r) }, http_responses: http_responses_data&.map { |r| HttpResponse.from_hash(r) }, expectation_ids: expectation_ids_data&.map { |e| ExpectationId.from_hash(e) } ) end |
Instance Method Details
#to_h ⇒ Object
2219 2220 2221 2222 2223 2224 2225 |
# File 'lib/mockserver/models.rb', line 2219 def to_h MockServer.strip_none({ 'httpRequests' => @http_requests&.map(&:to_h), 'httpResponses' => @http_responses&.map(&:to_h), 'expectationIds' => @expectation_ids&.map(&:to_h) }) end |