Class: Telesign::API::APIResponse

Inherits:
Object
  • Object
show all
Defined in:
lib/telesign/rest.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(http_response, verify_code = nil) ⇒ APIResponse

Returns a new instance of APIResponse.



142
143
144
145
146
147
148
149
# File 'lib/telesign/rest.rb', line 142

def initialize(http_response,
               verify_code=nil)

  @body = JSON.parse(http_response.body)
  @headers = http_response.to_hash
  @status = http_response.code
  @verify_code = verify_code
end

Instance Attribute Details

#bodyObject

Returns the value of attribute body.



140
141
142
# File 'lib/telesign/rest.rb', line 140

def body
  @body
end

#headersObject

Returns the value of attribute headers.



140
141
142
# File 'lib/telesign/rest.rb', line 140

def headers
  @headers
end

#statusObject

Returns the value of attribute status.



140
141
142
# File 'lib/telesign/rest.rb', line 140

def status
  @status
end

#verify_codeObject

Returns the value of attribute verify_code.



140
141
142
# File 'lib/telesign/rest.rb', line 140

def verify_code
  @verify_code
end