Class: Aliyun::ESS::Base::Response
- Inherits:
-
String
- Object
- String
- Aliyun::ESS::Base::Response
show all
- Defined in:
- lib/aliyun/ess/response.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods inherited from String
#camelize, #remove_extended, #remove_extended!, #underscore, #valid_utf8?
Constructor Details
#initialize(response) ⇒ Response
8
9
10
11
12
|
# File 'lib/aliyun/ess/response.rb', line 8
def initialize(response)
@response = response
@body = response.body.to_s
super(body)
end
|
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body.
7
8
9
|
# File 'lib/aliyun/ess/response.rb', line 7
def body
@body
end
|
#parsed ⇒ Object
Returns the value of attribute parsed.
7
8
9
|
# File 'lib/aliyun/ess/response.rb', line 7
def parsed
@parsed
end
|
#response ⇒ Object
Returns the value of attribute response.
7
8
9
|
# File 'lib/aliyun/ess/response.rb', line 7
def response
@response
end
|
Instance Method Details
#[](header) ⇒ Object
24
25
26
|
# File 'lib/aliyun/ess/response.rb', line 24
def []()
[]
end
|
#code ⇒ Object
32
33
34
|
# File 'lib/aliyun/ess/response.rb', line 32
def code
response.code.to_i
end
|
#each(&block) ⇒ Object
28
29
30
|
# File 'lib/aliyun/ess/response.rb', line 28
def each(&block)
.each(&block)
end
|
#error ⇒ Object
50
51
52
|
# File 'lib/aliyun/ess/response.rb', line 50
def error
@error ||= Error.new(parsed, self)
end
|
#error? ⇒ Boolean
46
47
48
|
# File 'lib/aliyun/ess/response.rb', line 46
def error?
!success? && !parsed.code.nil?
end
|
14
15
16
17
18
19
20
21
22
|
# File 'lib/aliyun/ess/response.rb', line 14
def
||= begin
= {}
response.each do |, value|
[] = value
end
end
end
|
#inspect ⇒ Object
59
60
61
|
# File 'lib/aliyun/ess/response.rb', line 59
def inspect
"#<%s:0x%s %s %s>" % [self.class, object_id, response.code, response.message]
end
|