Class: AWS::S3::Base::Response
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from String
#previous, #previous!, #remove_extended, #remove_extended!, #tap, #to_header, #underscore, #valid_utf8?
Constructor Details
#initialize(response) ⇒ Response
Returns a new instance of Response.
7
8
9
10
11
|
# File 'lib/aws/s3/response.rb', line 7
def initialize(response)
@response = response
@body = response.body.to_s
super(body)
end
|
Instance Attribute Details
Returns the value of attribute body.
6
7
8
|
# File 'lib/aws/s3/response.rb', line 6
def body
@body
end
|
Returns the value of attribute parsed.
6
7
8
|
# File 'lib/aws/s3/response.rb', line 6
def parsed
@parsed
end
|
Returns the value of attribute response.
6
7
8
|
# File 'lib/aws/s3/response.rb', line 6
def response
@response
end
|
Instance Method Details
#[](header) ⇒ Object
22
23
24
|
# File 'lib/aws/s3/response.rb', line 22
def []()
[]
end
|
30
31
32
|
# File 'lib/aws/s3/response.rb', line 30
def code
response.code.to_i
end
|
#each(&block) ⇒ Object
26
27
28
|
# File 'lib/aws/s3/response.rb', line 26
def each(&block)
.each(&block)
end
|
48
49
50
|
# File 'lib/aws/s3/response.rb', line 48
def error
Error.new(parsed, self)
end
|
#error? ⇒ Boolean
44
45
46
|
# File 'lib/aws/s3/response.rb', line 44
def error?
!success? && response['content-type'] == 'application/xml' && parsed.root == 'error'
end
|
13
14
15
16
17
18
19
|
# File 'lib/aws/s3/response.rb', line 13
def
= {}
response.each do |, value|
[] = value
end
end
|
59
60
61
|
# File 'lib/aws/s3/response.rb', line 59
def inspect
"#<%s:0x%s %s %s>" % [self.class, object_id, response.code, response.message]
end
|