Class: Boechat::Core::Service::Result

Inherits:
Object
  • Object
show all
Defined in:
lib/boechat/core/service/result.rb

Overview

Class responsible for store the response of the Request class

Instance Attribute Summary collapse

Instance Method Summary collapse

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_responseObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/boechat/core/service/result.rb', line 20

def failure?
  @parsed_response && @parsed_response[:status] >= 400
end

#success?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/boechat/core/service/result.rb', line 16

def success?
  @parsed_response && @parsed_response[:status] < 400
end