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.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(http_requests: nil, expectation_ids: nil) ⇒ VerificationSequence
constructor
A new instance of VerificationSequence.
- #to_h ⇒ Object
Constructor Details
#initialize(http_requests: nil, expectation_ids: nil) ⇒ VerificationSequence
Returns a new instance of VerificationSequence.
1432 1433 1434 1435 |
# File 'lib/mockserver/models.rb', line 1432 def initialize(http_requests: nil, expectation_ids: nil) @http_requests = http_requests @expectation_ids = expectation_ids end |
Instance Attribute Details
#expectation_ids ⇒ Object
Returns the value of attribute expectation_ids.
1430 1431 1432 |
# File 'lib/mockserver/models.rb', line 1430 def expectation_ids @expectation_ids end |
#http_requests ⇒ Object
Returns the value of attribute http_requests.
1430 1431 1432 |
# File 'lib/mockserver/models.rb', line 1430 def http_requests @http_requests end |
Class Method Details
.from_hash(data) ⇒ Object
1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 |
# File 'lib/mockserver/models.rb', line 1444 def self.from_hash(data) return nil if data.nil? http_requests_data = data['httpRequests'] expectation_ids_data = data['expectationIds'] new( http_requests: http_requests_data&.map { |r| HttpRequest.from_hash(r) }, expectation_ids: expectation_ids_data&.map { |e| ExpectationId.from_hash(e) } ) end |
Instance Method Details
#to_h ⇒ Object
1437 1438 1439 1440 1441 1442 |
# File 'lib/mockserver/models.rb', line 1437 def to_h MockServer.strip_none({ 'httpRequests' => @http_requests&.map(&:to_h), 'expectationIds' => @expectation_ids&.map(&:to_h) }) end |