Class: EnotasApi::RawResult
- Inherits:
-
Object
- Object
- EnotasApi::RawResult
- Defined in:
- lib/enotas_api/common/raw_result.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content ⇒ Object
readonly
Returns the value of attribute content.
-
#raw_content ⇒ Object
readonly
Returns the value of attribute raw_content.
-
#status_code ⇒ Object
readonly
Returns the value of attribute status_code.
Instance Method Summary collapse
- #error? ⇒ Boolean
-
#initialize(status_code, content, raw_content = nil) ⇒ RawResult
constructor
A new instance of RawResult.
- #success? ⇒ Boolean
Constructor Details
#initialize(status_code, content, raw_content = nil) ⇒ RawResult
Returns a new instance of RawResult.
7 8 9 10 11 |
# File 'lib/enotas_api/common/raw_result.rb', line 7 def initialize(status_code, content, raw_content = nil) @status_code = status_code @content = content @raw_content = raw_content || content end |
Instance Attribute Details
#content ⇒ Object (readonly)
Returns the value of attribute content.
5 6 7 |
# File 'lib/enotas_api/common/raw_result.rb', line 5 def content @content end |
#raw_content ⇒ Object (readonly)
Returns the value of attribute raw_content.
5 6 7 |
# File 'lib/enotas_api/common/raw_result.rb', line 5 def raw_content @raw_content end |
#status_code ⇒ Object (readonly)
Returns the value of attribute status_code.
5 6 7 |
# File 'lib/enotas_api/common/raw_result.rb', line 5 def status_code @status_code end |
Instance Method Details
#error? ⇒ Boolean
17 18 19 |
# File 'lib/enotas_api/common/raw_result.rb', line 17 def error? !success? end |
#success? ⇒ Boolean
13 14 15 |
# File 'lib/enotas_api/common/raw_result.rb', line 13 def success? status_code.between?(200, 299) end |