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.
1845 1846 1847 1848 |
# File 'lib/mockserver/models.rb', line 1845 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.
1843 1844 1845 |
# File 'lib/mockserver/models.rb', line 1843 def operations_and_responses @operations_and_responses end |
#spec_url_or_payload ⇒ Object
Returns the value of attribute spec_url_or_payload.
1843 1844 1845 |
# File 'lib/mockserver/models.rb', line 1843 def spec_url_or_payload @spec_url_or_payload end |
Class Method Details
.from_hash(data) ⇒ Object
1857 1858 1859 1860 1861 1862 1863 1864 |
# File 'lib/mockserver/models.rb', line 1857 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
1850 1851 1852 1853 1854 1855 |
# File 'lib/mockserver/models.rb', line 1850 def to_h MockServer.strip_none({ 'specUrlOrPayload' => @spec_url_or_payload, 'operationsAndResponses' => @operations_and_responses }) end |