Exception: SmsManager::SendingError
- Inherits:
-
StandardError
- Object
- StandardError
- SmsManager::SendingError
- Defined in:
- lib/sms_manager/error/sending_error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
-
#initialize(options, body) ⇒ SendingError
constructor
A new instance of SendingError.
- #message ⇒ Object
Constructor Details
#initialize(options, body) ⇒ SendingError
Returns a new instance of SendingError.
5 6 7 8 |
# File 'lib/sms_manager/error/sending_error.rb', line 5 def initialize(, body) @code = body.split('|').last.to_i @options = end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/sms_manager/error/sending_error.rb', line 3 def code @code end |
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/sms_manager/error/sending_error.rb', line 3 def @options end |
Instance Method Details
#message ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/sms_manager/error/sending_error.rb', line 10 def if code >= 900 && code <= 999 CODE_9XX elsif CODES[code] CODES[code] else 'Neznámý chybový kód' end end |