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

more consistent params handling for s3 objects

This commit is contained in:
Wesley Beary 2009-10-06 19:16:12 -07:00
parent 13e3336e9b
commit 5dbed998a6
2 changed files with 16 additions and 5 deletions

View file

@ -44,7 +44,7 @@ module Fog
options[key] = value
end
end
bucket.objects.merge_attributes(:options => options)
bucket.objects.merge_attributes(options)
data['Contents'].each do |object|
owner = Fog::AWS::S3::Owner.new(object.delete('Owner').merge!(:connection => connection))
bucket.objects << Fog::AWS::S3::Object.new({

View file

@ -4,11 +4,17 @@ module Fog
class Objects < Fog::Collection
attribute :options
attribute :delimiter, 'Delimiter'
attribute :is_truncated, 'IsTruncated'
attribute :marker, 'Marker'
attribute :max_keys, 'MaxKeys'
attribute :prefix, 'Prefix'
def all(options = {})
merge_attributes(:options => options)
bucket.buckets.get(bucket.name, @options).objects
bucket.buckets.get(
bucket.name,
options.reject {|key, value| !['delimiter', 'marker', 'max-keys', 'prefix'].include?(key)}
).objects
end
def bucket
@ -75,7 +81,12 @@ module Fog
end
def reload
all(@options)
all({
'delimiter' => @delimiter,
'marker' => @marker,
'max-keys' => @max_keys,
'prefix' => @prefix
})
end
private