Class: MockServer::OpenAPIExpectation
- Inherits:
-
Object
- Object
- MockServer::OpenAPIExpectation
- Defined in:
- lib/mockserver/models.rb
Instance Attribute Summary collapse
-
#operations_and_responses ⇒ Object
Returns the value of attribute operations_and_responses.
-
#spec_url_or_payload ⇒ Object
Returns the value of attribute spec_url_or_payload.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(spec_url_or_payload: nil, operations_and_responses: nil) ⇒ OpenAPIExpectation
constructor
A new instance of OpenAPIExpectation.
- #to_h ⇒ Object
Constructor Details
#initialize(spec_url_or_payload: nil, operations_and_responses: nil) ⇒ OpenAPIExpectation
Returns a new instance of OpenAPIExpectation.
2614 2615 2616 2617 |
# File 'lib/mockserver/models.rb', line 2614 def initialize(spec_url_or_payload: nil, operations_and_responses: nil) @spec_url_or_payload = spec_url_or_payload @operations_and_responses = operations_and_responses end |
Instance Attribute Details
#operations_and_responses ⇒ Object
Returns the value of attribute operations_and_responses.
2612 2613 2614 |
# File 'lib/mockserver/models.rb', line 2612 def operations_and_responses @operations_and_responses end |
#spec_url_or_payload ⇒ Object
Returns the value of attribute spec_url_or_payload.
2612 2613 2614 |
# File 'lib/mockserver/models.rb', line 2612 def spec_url_or_payload @spec_url_or_payload end |
Class Method Details
.from_hash(data) ⇒ Object
2626 2627 2628 2629 2630 2631 2632 2633 |
# File 'lib/mockserver/models.rb', line 2626 def self.from_hash(data) return nil if data.nil? new( spec_url_or_payload: data['specUrlOrPayload'], operations_and_responses: data['operationsAndResponses'] ) end |
Instance Method Details
#to_h ⇒ Object
2619 2620 2621 2622 2623 2624 |
# File 'lib/mockserver/models.rb', line 2619 def to_h MockServer.strip_none({ 'specUrlOrPayload' => @spec_url_or_payload, 'operationsAndResponses' => @operations_and_responses }) end |