diff --git a/lib/fog/aws/models/s3/buckets.rb b/lib/fog/aws/models/s3/buckets.rb index 3a8028601..f86c78e13 100644 --- a/lib/fog/aws/models/s3/buckets.rb +++ b/lib/fog/aws/models/s3/buckets.rb @@ -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({ diff --git a/lib/fog/aws/models/s3/objects.rb b/lib/fog/aws/models/s3/objects.rb index 35168b358..17842485f 100644 --- a/lib/fog/aws/models/s3/objects.rb +++ b/lib/fog/aws/models/s3/objects.rb @@ -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