Class: Telesign::API::APIResponse
- Inherits:
-
Object
- Object
- Telesign::API::APIResponse
- Defined in:
- lib/telesign/rest.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
-
#headers ⇒ Object
Returns the value of attribute headers.
-
#status ⇒ Object
Returns the value of attribute status.
-
#verify_code ⇒ Object
Returns the value of attribute verify_code.
Instance Method Summary collapse
-
#initialize(http_response, verify_code = nil) ⇒ APIResponse
constructor
A new instance of APIResponse.
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
#body ⇒ Object
Returns the value of attribute body.
140 141 142 |
# File 'lib/telesign/rest.rb', line 140 def body @body end |
#headers ⇒ Object
Returns the value of attribute headers.
140 141 142 |
# File 'lib/telesign/rest.rb', line 140 def headers @headers end |
#status ⇒ Object
Returns the value of attribute status.
140 141 142 |
# File 'lib/telesign/rest.rb', line 140 def status @status end |
#verify_code ⇒ Object
Returns the value of attribute verify_code.
140 141 142 |
# File 'lib/telesign/rest.rb', line 140 def verify_code @verify_code end |