Exception: Laddro::APIError
- Inherits:
-
StandardError
- Object
- StandardError
- Laddro::APIError
- Defined in:
- lib/laddro/error.rb
Instance Attribute Summary collapse
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
- #auth_error? ⇒ Boolean
-
#initialize(message, status, code = nil) ⇒ APIError
constructor
A new instance of APIError.
- #not_found? ⇒ Boolean
- #usage_limit_error? ⇒ Boolean
Constructor Details
#initialize(message, status, code = nil) ⇒ APIError
Returns a new instance of APIError.
5 6 7 8 9 |
# File 'lib/laddro/error.rb', line 5 def initialize(, status, code = nil) super() @status = status @code = code end |
Instance Attribute Details
#code ⇒ Object (readonly)
Returns the value of attribute code.
3 4 5 |
# File 'lib/laddro/error.rb', line 3 def code @code end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
3 4 5 |
# File 'lib/laddro/error.rb', line 3 def status @status end |
Instance Method Details
#auth_error? ⇒ Boolean
11 12 13 |
# File 'lib/laddro/error.rb', line 11 def auth_error? status == 401 end |
#not_found? ⇒ Boolean
19 20 21 |
# File 'lib/laddro/error.rb', line 19 def not_found? status == 404 end |
#usage_limit_error? ⇒ Boolean
15 16 17 |
# File 'lib/laddro/error.rb', line 15 def usage_limit_error? status == 402 end |