Exception: AliexpressAPI::ResultError
- Defined in:
- lib/aliexpress_api/exceptions.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(result, message: nil) ⇒ ResultError
constructor
A new instance of ResultError.
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(result, message: nil) ⇒ ResultError
Returns a new instance of ResultError.
49 50 51 52 |
# File 'lib/aliexpress_api/exceptions.rb', line 49 def initialize(result, message: nil) @result = result = end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
47 48 49 |
# File 'lib/aliexpress_api/exceptions.rb', line 47 def result @result end |
Instance Method Details
#message ⇒ Object
54 55 56 |
# File 'lib/aliexpress_api/exceptions.rb', line 54 def .present? ? : to_s end |
#to_s ⇒ Object
58 59 60 61 62 |
# File 'lib/aliexpress_api/exceptions.rb', line 58 def to_s return "Failed. #{@result.to_json}." if @result.respond_to?(:to_json) "Failed. #{@result}." end |