Exception: PCO::API::Errors::BaseError
- Inherits:
-
StandardError
- Object
- StandardError
- PCO::API::Errors::BaseError
- Defined in:
- lib/pco/api/errors.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#detail ⇒ Object
readonly
Returns the value of attribute detail.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(response) ⇒ BaseError
constructor
A new instance of BaseError.
- #inspect ⇒ Object
- #message ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(response) ⇒ BaseError
Returns a new instance of BaseError.
9 10 11 12 |
# File 'lib/pco/api/errors.rb', line 9 def initialize(response) @status = response.status @detail = response.body end |
Instance Attribute Details
#detail ⇒ Object (readonly)
Returns the value of attribute detail.
7 8 9 |
# File 'lib/pco/api/errors.rb', line 7 def detail @detail end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
7 8 9 |
# File 'lib/pco/api/errors.rb', line 7 def status @status end |
Instance Method Details
#inspect ⇒ Object
23 24 25 |
# File 'lib/pco/api/errors.rb', line 23 def inspect "<#{self.class.name} status=#{status} message=#{message.inspect} detail=#{detail.inspect}>" end |
#message ⇒ Object
18 19 20 21 |
# File 'lib/pco/api/errors.rb', line 18 def return detail.to_s unless detail.is_a?(Hash) detail['message'] || || detail.to_s end |
#to_s ⇒ Object
14 15 16 |
# File 'lib/pco/api/errors.rb', line 14 def to_s end |