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.
1329 1330 1331 1332 |
# File 'lib/mockserver/models.rb', line 1329 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.
1327 1328 1329 |
# File 'lib/mockserver/models.rb', line 1327 def operations_and_responses @operations_and_responses end |
#spec_url_or_payload ⇒ Object
Returns the value of attribute spec_url_or_payload.
1327 1328 1329 |
# File 'lib/mockserver/models.rb', line 1327 def spec_url_or_payload @spec_url_or_payload end |
Class Method Details
.from_hash(data) ⇒ Object
1341 1342 1343 1344 1345 1346 1347 1348 |
# File 'lib/mockserver/models.rb', line 1341 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
1334 1335 1336 1337 1338 1339 |
# File 'lib/mockserver/models.rb', line 1334 def to_h MockServer.strip_none({ 'specUrlOrPayload' => @spec_url_or_payload, 'operationsAndResponses' => @operations_and_responses }) end |