Exception: Apress::Moysklad::Api::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Apress::Moysklad::Api::Error
- Defined in:
- lib/apress/moysklad/api/error.rb
Overview
Ошибка при взаимодействии с API МойСклад
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
Instance Method Summary collapse
-
#initialize(msg, code = nil) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(msg, code = nil) ⇒ Error
Returns a new instance of Error.
8 9 10 11 12 13 14 |
# File 'lib/apress/moysklad/api/error.rb', line 8 def initialize(msg, code = nil) @code = code.to_i = code ? "#{code} - #{msg}" : msg super .force_encoding('UTF-8') end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
6 7 8 |
# File 'lib/apress/moysklad/api/error.rb', line 6 def code @code end |