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:
commit
4baad70757
1 changed files with 8 additions and 4 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in a new issue