class Telesign::RestClient::Response
-
http_response
- A net/http response object.
Attributes
body[RW]
headers[RW]
json[RW]
ok[RW]
status_code[RW]
Public Class Methods
new(http_response)
click to toggle source
# File lib/telesign/rest.rb, line 30 def initialize(http_response) @status_code = http_response.code @headers = http_response.to_hash @body = http_response.body @ok = http_response.kind_of? Net::HTTPSuccess begin @json = JSON.parse(http_response.body) rescue JSON::JSONError @json = nil end end