Class: Ebanx::Response

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response, response_type) ⇒ Response

Returns a new instance of Response.



5
6
7
8
9
10
11
# File 'lib/ebanx/response.rb', line 5

def initialize(response, response_type)
  @http_code    = response.code
  @raw_response = response.to_str
  @response     = response.to_str

  @response = JSON.parse @response if response_type == :json
end

Instance Attribute Details

#http_codeObject

Returns the value of attribute http_code.



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

def http_code
  @http_code
end

#raw_responseObject

Returns the value of attribute raw_response.



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

def raw_response
  @raw_response
end

#responseObject

Returns the value of attribute response.



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

def response
  @response
end