Class: Boechat::Core::Service::Result
- Inherits:
-
Object
- Object
- Boechat::Core::Service::Result
- Defined in:
- lib/boechat/core/service/result.rb
Overview
Class responsible for store the response of the Request class
Instance Attribute Summary collapse
-
#parsed_response ⇒ Object
readonly
Returns the value of attribute parsed_response.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(parsed_response) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
Constructor Details
#initialize(parsed_response) ⇒ Result
Returns a new instance of Result.
12 13 14 |
# File 'lib/boechat/core/service/result.rb', line 12 def initialize(parsed_response) @parsed_response = parsed_response end |
Instance Attribute Details
#parsed_response ⇒ Object (readonly)
Returns the value of attribute parsed_response.
10 11 12 |
# File 'lib/boechat/core/service/result.rb', line 10 def parsed_response @parsed_response end |
Instance Method Details
#failure? ⇒ Boolean
20 21 22 |
# File 'lib/boechat/core/service/result.rb', line 20 def failure? @parsed_response && @parsed_response[:status] >= 400 end |
#success? ⇒ Boolean
16 17 18 |
# File 'lib/boechat/core/service/result.rb', line 16 def success? @parsed_response && @parsed_response[:status] < 400 end |