Exception: Unit::Error
- Inherits:
-
StandardError
- Object
- StandardError
- Unit::Error
- Defined in:
- lib/unit-ruby/util/error.rb
Instance Attribute Summary collapse
-
#detail ⇒ Object
Returns the value of attribute detail.
-
#details ⇒ Object
Returns the value of attribute details.
-
#message ⇒ Object
Returns the value of attribute message.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
-
#initialize(api_response) ⇒ Error
constructor
A new instance of Error.
Constructor Details
#initialize(api_response) ⇒ Error
Returns a new instance of Error.
5 6 7 8 9 10 11 12 |
# File 'lib/unit-ruby/util/error.rb', line 5 def initialize(api_response) error = api_response['errors'].first @message = error['title'] @status = error['status'] @details = error['details'] || error['detail'] super(@details) end |
Instance Attribute Details
#detail ⇒ Object
Returns the value of attribute detail.
3 4 5 |
# File 'lib/unit-ruby/util/error.rb', line 3 def detail @detail end |
#details ⇒ Object
Returns the value of attribute details.
3 4 5 |
# File 'lib/unit-ruby/util/error.rb', line 3 def details @details end |
#message ⇒ Object
Returns the value of attribute message.
3 4 5 |
# File 'lib/unit-ruby/util/error.rb', line 3 def @message end |
#status ⇒ Object
Returns the value of attribute status.
3 4 5 |
# File 'lib/unit-ruby/util/error.rb', line 3 def status @status end |