class AmazonDrs::Error

Attributes

error[RW]
error_description[RW]
message[RW]

Public Instance Methods

inspect() click to toggle source
# 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) click to toggle source
# 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() click to toggle source
# File lib/amazon-drs/error.rb, line 23
def to_s
  inspect
end