class AWS::SES::Response
Attributes
action[R]
body[R]
parsed[R]
response[R]
Public Class Methods
new(action, response)
click to toggle source
Calls superclass method
# File lib/aws/ses/response.rb, line 6 def initialize(action, response) @action = action @response = response @body = response.body.to_s super(body) end
Public Instance Methods
[](header)
click to toggle source
# File lib/aws/ses/response.rb, line 22 def [](header) headers[header] end
code()
click to toggle source
# File lib/aws/ses/response.rb, line 30 def code response.code.to_i end
each(&block)
click to toggle source
# File lib/aws/ses/response.rb, line 26 def each(&block) headers.each(&block) end
error()
click to toggle source
# File lib/aws/ses/response.rb, line 48 def error parsed['Error'] end
error?()
click to toggle source
# File lib/aws/ses/response.rb, line 44 def error? !success? && (response['content-type'] == 'application/xml' || response['content-type'] == 'text/xml') end
headers()
click to toggle source
# File lib/aws/ses/response.rb, line 13 def headers headers = {} response.each do |header, value| headers[header] = value end headers end
inspect()
click to toggle source
# File lib/aws/ses/response.rb, line 70 def inspect "#<%s:0x%s %s %s %s>" % [self.class, object_id, request_id, response.code, response.message] end
request_id()
click to toggle source
# File lib/aws/ses/response.rb, line 66 def request_id error? ? parsed['RequestId'] : parsed['ResponseMetadata']['RequestId'] end
result()
click to toggle source
It's expected that each subclass of Response will override this method with what part of response is relevant
# File lib/aws/ses/response.rb, line 62 def result parsed end