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.
1979 1980 1981 1982 1983 |
# File 'lib/mockserver/models.rb', line 1979 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.
1977 1978 1979 |
# File 'lib/mockserver/models.rb', line 1977 def expectation_ids @expectation_ids end |
#http_requests ⇒ Object
Returns the value of attribute http_requests.
1977 1978 1979 |
# File 'lib/mockserver/models.rb', line 1977 def http_requests @http_requests end |
#http_responses ⇒ Object
Returns the value of attribute http_responses.
1977 1978 1979 |
# File 'lib/mockserver/models.rb', line 1977 def http_responses @http_responses end |
Class Method Details
.from_hash(data) ⇒ Object
1993 1994 1995 1996 1997 1998 1999 2000 2001 2002 2003 2004 |
# File 'lib/mockserver/models.rb', line 1993 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
1985 1986 1987 1988 1989 1990 1991 |
# File 'lib/mockserver/models.rb', line 1985 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 |