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.
1948 1949 1950 1951 |
# File 'lib/mockserver/models.rb', line 1948 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.
1946 1947 1948 |
# File 'lib/mockserver/models.rb', line 1946 def expectation_ids @expectation_ids end |
#http_requests ⇒ Object
Returns the value of attribute http_requests.
1946 1947 1948 |
# File 'lib/mockserver/models.rb', line 1946 def http_requests @http_requests end |
Class Method Details
.from_hash(data) ⇒ Object
1960 1961 1962 1963 1964 1965 1966 1967 1968 1969 |
# File 'lib/mockserver/models.rb', line 1960 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
1953 1954 1955 1956 1957 1958 |
# File 'lib/mockserver/models.rb', line 1953 def to_h MockServer.strip_none({ 'httpRequests' => @http_requests&.map(&:to_h), 'expectationIds' => @expectation_ids&.map(&:to_h) }) end |