Class: Akamai::Core::Client::Error
- Inherits:
-
Object
- Object
- Akamai::Core::Client::Error
- Defined in:
- lib/akamai/core/client/error.rb
Defined Under Namespace
Classes: AkamaiError
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
Instance Method Summary collapse
- #exist? ⇒ Boolean
-
#initialize(body) ⇒ Error
constructor
A new instance of Error.
- #raise_error ⇒ Object
Constructor Details
#initialize(body) ⇒ Error
Returns a new instance of Error.
10 11 12 |
# File 'lib/akamai/core/client/error.rb', line 10 def initialize(body) @body = /Array/ =~ body.class.name ? body[0] : body end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
9 10 11 |
# File 'lib/akamai/core/client/error.rb', line 9 def body @body end |
Instance Method Details
#exist? ⇒ Boolean
14 15 16 |
# File 'lib/akamai/core/client/error.rb', line 14 def exist? !! end |
#raise_error ⇒ Object
18 19 20 21 22 23 |
# File 'lib/akamai/core/client/error.rb', line 18 def raise_error error = AkamaiError.new.tap do |akamai_error| akamai_error.body = body end raise(error, ) if exist? end |