Exception: OrangeSms::Error::AuthenticationError
- Inherits:
-
StandardError
- Object
- StandardError
- OrangeSms::Error::AuthenticationError
- Defined in:
- lib/orange_sms/error.rb
Instance Attribute Summary collapse
-
#error_message ⇒ Object
readonly
Returns the value of attribute error_message.
-
#message ⇒ Object
readonly
Returns the value of attribute message.
-
#more_info ⇒ Object
readonly
Returns the value of attribute more_info.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(message, response) ⇒ AuthenticationError
constructor
A new instance of AuthenticationError.
- #to_s ⇒ Object
Constructor Details
#initialize(message, response) ⇒ AuthenticationError
Returns a new instance of AuthenticationError.
6 7 8 9 10 11 12 13 |
# File 'lib/orange_sms/error.rb', line 6 def initialize(, response) @status = response.status body = JSON.parse(response.body) = body.fetch('error', nil) @more_info = body.fetch('error_description', nil) = () @response = response end |
Instance Attribute Details
#error_message ⇒ Object (readonly)
Returns the value of attribute error_message.
4 5 6 |
# File 'lib/orange_sms/error.rb', line 4 def end |
#message ⇒ Object (readonly)
Returns the value of attribute message.
4 5 6 |
# File 'lib/orange_sms/error.rb', line 4 def end |
#more_info ⇒ Object (readonly)
Returns the value of attribute more_info.
4 5 6 |
# File 'lib/orange_sms/error.rb', line 4 def more_info @more_info end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
4 5 6 |
# File 'lib/orange_sms/error.rb', line 4 def response @response end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
4 5 6 |
# File 'lib/orange_sms/error.rb', line 4 def status @status end |
Instance Method Details
#to_s ⇒ Object
15 16 17 |
# File 'lib/orange_sms/error.rb', line 15 def to_s end |