Class: RiotKit::Http::Response
- Inherits:
-
Object
- Object
- RiotKit::Http::Response
- Defined in:
- lib/riot_kit/http/response.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#result ⇒ Object
readonly
Returns the value of attribute result.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(status:, result: nil, error: nil) ⇒ Response
constructor
A new instance of Response.
- #success? ⇒ Boolean
Constructor Details
#initialize(status:, result: nil, error: nil) ⇒ Response
Returns a new instance of Response.
8 9 10 11 12 |
# File 'lib/riot_kit/http/response.rb', line 8 def initialize(status:, result: nil, error: nil) @status = status.to_i @result = result @error = error end |
Instance Attribute Details
#error ⇒ Object (readonly)
Returns the value of attribute error.
6 7 8 |
# File 'lib/riot_kit/http/response.rb', line 6 def error @error end |
#result ⇒ Object (readonly)
Returns the value of attribute result.
6 7 8 |
# File 'lib/riot_kit/http/response.rb', line 6 def result @result end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/riot_kit/http/response.rb', line 6 def status @status end |
Instance Method Details
#success? ⇒ Boolean
14 15 16 |
# File 'lib/riot_kit/http/response.rb', line 14 def success? status.between?(200, 299) end |