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:
parent
13e3336e9b
commit
5dbed998a6
2 changed files with 16 additions and 5 deletions
|
@ -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({
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue