Class: AmazonDrs::Error
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
-
#error_description ⇒ Object
Returns the value of attribute error_description.
-
#message ⇒ Object
Returns the value of attribute message.
Attributes inherited from Base
#date, #error_description_url, #error_type, #request_id, #status_code
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from AmazonDrs::Base
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
5 6 7 |
# File 'lib/amazon-drs/error.rb', line 5 def error @error end |
#error_description ⇒ Object
Returns the value of attribute error_description.
5 6 7 |
# File 'lib/amazon-drs/error.rb', line 5 def error_description @error_description end |
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/amazon-drs/error.rb', line 5 def @message end |
Instance Method Details
#inspect ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/amazon-drs/error.rb', line 14 def inspect resp = 'ERROR' resp += " #{@error}" if instance_variable_defined?(:@error) && @error resp += ': ' resp += @message if instance_variable_defined?(:@message) && @message resp += @error_description if instance_variable_defined?(:@error_description) && @error_description resp end |
#parse_body(body) ⇒ Object
7 8 9 10 11 12 |
# File 'lib/amazon-drs/error.rb', line 7 def parse_body(body) json = JSON.parse(body) @message = json['message'] if json['message'] @error = json['error'] if json['error'] @error_description = json['error_description'] if json['error_description'] end |
#to_s ⇒ Object
23 24 25 |
# File 'lib/amazon-drs/error.rb', line 23 def to_s inspect end |