Class: OasParser::Response
- Includes:
- RawAccessor
- Defined in:
- lib/oas_parser/response.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#raw ⇒ Object
Returns the value of attribute raw.
Instance Method Summary collapse
-
#initialize(endpoint, code, raw) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Methods included from RawAccessor
included, #method_missing, #respond_to_missing?
Methods inherited from Payload
#exhibits_one_of_multiple_schemas?, #formats, #schema, #split_schemas
Constructor Details
#initialize(endpoint, code, raw) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 |
# File 'lib/oas_parser/response.rb', line 8 def initialize(endpoint, code, raw) @endpoint = endpoint @code = code @raw = raw end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class OasParser::RawAccessor
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
6 7 8 |
# File 'lib/oas_parser/response.rb', line 6 def code @code end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
6 7 8 |
# File 'lib/oas_parser/response.rb', line 6 def endpoint @endpoint end |
#raw ⇒ Object
Returns the value of attribute raw.
6 7 8 |
# File 'lib/oas_parser/response.rb', line 6 def raw @raw end |
Instance Method Details
#success? ⇒ Boolean
14 15 16 |
# File 'lib/oas_parser/response.rb', line 14 def success? code.match?(/^2\d\d$/) end |