1
0
Fork 0
mirror of https://github.com/fog/fog.git synced 2022-11-09 13:51:43 -05:00

Update call to include response_block rather than passing a block, to conform to excon deprecation message.

Fix code when block is not passed.
This commit is contained in:
Rupak Ganguly 2012-06-19 15:22:12 -04:00
parent dab0fcc33f
commit 2c37b04860

View file

@ -10,12 +10,21 @@ module Fog
# * object<~String> - Name of object to look for
#
def get_object(container, object, &block)
response = request({
:block => block,
:expects => 200,
:method => 'GET',
:path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
}, false, &block)
if block_given?
response = request(
:response_block => block,
:expects => 200,
:method => 'GET',
:path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
)
else
response = request({
:block => block,
:expects => 200,
:method => 'GET',
:path => "#{Fog::HP.escape(container)}/#{Fog::HP.escape(object)}"
}, false, &block)
end
response
end