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.
1873 1874 1875 1876 |
# File 'lib/mockserver/models.rb', line 1873 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.
1871 1872 1873 |
# File 'lib/mockserver/models.rb', line 1871 def operations_and_responses @operations_and_responses end |
#spec_url_or_payload ⇒ Object
Returns the value of attribute spec_url_or_payload.
1871 1872 1873 |
# File 'lib/mockserver/models.rb', line 1871 def spec_url_or_payload @spec_url_or_payload end |
Class Method Details
.from_hash(data) ⇒ Object
1885 1886 1887 1888 1889 1890 1891 1892 |
# File 'lib/mockserver/models.rb', line 1885 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
1878 1879 1880 1881 1882 1883 |
# File 'lib/mockserver/models.rb', line 1878 def to_h MockServer.strip_none({ 'specUrlOrPayload' => @spec_url_or_payload, 'operationsAndResponses' => @operations_and_responses }) end |