Class: AWS::SES::Response
- Inherits:
-
String
- Object
- String
- AWS::SES::Response
show all
- Defined in:
- lib/aws/ses/response.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(action, response) ⇒ Response
Returns a new instance of Response.
6
7
8
9
10
11
|
# File 'lib/aws/ses/response.rb', line 6
def initialize(action, response)
@action = action
@response = response
@body = response.body.to_s
super(body)
end
|
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
4
5
6
|
# File 'lib/aws/ses/response.rb', line 4
def action
@action
end
|
#body ⇒ Object
Returns the value of attribute body.
4
5
6
|
# File 'lib/aws/ses/response.rb', line 4
def body
@body
end
|
#parsed ⇒ Object
Returns the value of attribute parsed.
4
5
6
|
# File 'lib/aws/ses/response.rb', line 4
def parsed
@parsed
end
|
#response ⇒ Object
Returns the value of attribute response.
4
5
6
|
# File 'lib/aws/ses/response.rb', line 4
def response
@response
end
|
Instance Method Details
#[](header) ⇒ Object
22
23
24
|
# File 'lib/aws/ses/response.rb', line 22
def []()
[]
end
|
#code ⇒ Object
30
31
32
|
# File 'lib/aws/ses/response.rb', line 30
def code
response.code.to_i
end
|
#each(&block) ⇒ Object
26
27
28
|
# File 'lib/aws/ses/response.rb', line 26
def each(&block)
.each(&block)
end
|
#error ⇒ Object
48
49
50
|
# File 'lib/aws/ses/response.rb', line 48
def error
parsed['Error']
end
|
#error? ⇒ Boolean
44
45
46
|
# File 'lib/aws/ses/response.rb', line 44
def error?
!success? && (response['content-type'] == 'application/xml' || response['content-type'] == 'text/xml')
end
|
13
14
15
16
17
18
19
|
# File 'lib/aws/ses/response.rb', line 13
def
= {}
response.each do |, value|
[] = value
end
end
|
#inspect ⇒ Object
70
71
72
|
# 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 ⇒ Object
66
67
68
|
# File 'lib/aws/ses/response.rb', line 66
def request_id
error? ? parsed['RequestId'] : parsed['ResponseMetadata']['RequestId']
end
|
#result ⇒ Object
It’s expected that each subclass of Response will override this method with what part of response is relevant
62
63
64
|
# File 'lib/aws/ses/response.rb', line 62
def result
parsed
end
|