Exception: TeleSign::TeleSignError
- Inherits:
-
StandardError
- Object
- StandardError
- TeleSign::TeleSignError
- Defined in:
- lib/telesign/telesign_error.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#data ⇒ Object
-
Attributes - * -
data- The data returned by the service, in a dictionary form.
-
-
#errors ⇒ Object
-
Attributes - * -
data- The data returned by the service, in a dictionary form.
-
-
#headers ⇒ Object
-
Attributes - * -
data- The data returned by the service, in a dictionary form.
-
-
#status ⇒ Object
-
Attributes - * -
data- The data returned by the service, in a dictionary form.
-
Instance Method Summary collapse
-
#initialize(response_json, http_response) ⇒ TeleSignError
constructor
A new instance of TeleSignError.
- #to_s ⇒ Object
Constructor Details
#initialize(response_json, http_response) ⇒ TeleSignError
Returns a new instance of TeleSignError.
14 15 16 17 18 19 20 |
# File 'lib/telesign/telesign_error.rb', line 14 def initialize response_json, http_response @errors = response_json['errors'] @headers = http_response.headers @status = http_response.status @data = http_response.body super() end |
Instance Attribute Details
#data ⇒ Object
-
Attributes
- -
data -
The data returned by the service, in a dictionary form.
-
-
http_response -
The full HTTP Response object, including the HTTP status code, headers, and raw returned data.
-
-
12 13 14 |
# File 'lib/telesign/telesign_error.rb', line 12 def data @data end |
#errors ⇒ Object
-
Attributes
- -
data -
The data returned by the service, in a dictionary form.
-
-
http_response -
The full HTTP Response object, including the HTTP status code, headers, and raw returned data.
-
-
12 13 14 |
# File 'lib/telesign/telesign_error.rb', line 12 def errors @errors end |
#headers ⇒ Object
-
Attributes
- -
data -
The data returned by the service, in a dictionary form.
-
-
http_response -
The full HTTP Response object, including the HTTP status code, headers, and raw returned data.
-
-
12 13 14 |
# File 'lib/telesign/telesign_error.rb', line 12 def headers @headers end |
#status ⇒ Object
-
Attributes
- -
data -
The data returned by the service, in a dictionary form.
-
-
http_response -
The full HTTP Response object, including the HTTP status code, headers, and raw returned data.
-
-
12 13 14 |
# File 'lib/telesign/telesign_error.rb', line 12 def status @status end |
Instance Method Details
#to_s ⇒ Object
22 23 24 |
# File 'lib/telesign/telesign_error.rb', line 22 def to_s @errors.inject(''){|ret, x| ret += "#{x['description']}\n" } end |