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

Merge pull request #78 from greysteil/clean-up-body-method

Remove assignment within conditional in File#body
This commit is contained in:
Wesley Beary 2015-03-25 11:27:30 -05:00
commit 4baad70757

View file

@ -50,15 +50,19 @@ module Fog
@acl = new_acl
end
# Get file's body if exists, else ' '.
# Get file's body if exists, else ''.
#
# @return [File]
#
def body
attributes[:body] ||= if last_modified && (file = collection.get(identity))
file.body
return attributes[:body] if attributes[:body]
return '' unless last_modified
file = collection.get(identity)
if file
attributes[:body] = file.body
else
''
attributes[:body] = ''
end
end