Class: MessageExchange::Response

Inherits:
Object
  • Object
show all
Defined in:
lib/message_exchange/response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_response) ⇒ Response

Returns a new instance of Response.



5
6
7
# File 'lib/message_exchange/response.rb', line 5

def initialize(api_response)
  @api_response = api_response
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



3
4
5
# File 'lib/message_exchange/response.rb', line 3

def body
  @body
end

#statusObject

Returns the value of attribute status.



3
4
5
# File 'lib/message_exchange/response.rb', line 3

def status
  @status
end

Instance Method Details

#success?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/message_exchange/response.rb', line 17

def success?
  (200..206).include?(status)
end