Sha256: a24aad4aec912a6e0aafb2107d31bdddf41dfe71c6aeca4191c9a09e2c88ee81

Contents?: true

Size: 1.07 KB

Versions: 50

Compression:

Stored size: 1.07 KB

Contents

module S3
  module ObjectsExtension
    # Builds the object in the bucket with given key
    def build(key)
      Object.send(:new, proxy_owner, :key => key)
    end

    # Finds first object with given name or raises the exception if
    # not found
    def find_first(name)
      object = build(name)
      object.retrieve
    end
    alias :find :find_first

    # Finds the objects in the bucket.
    #
    # ==== Options
    # * <tt>:prefix</tt> - Limits the response to keys which begin
    #   with the indicated prefix
    # * <tt>:marker</tt> - Indicates where in the bucket to begin
    #   listing
    # * <tt>:max_keys</tt> - The maximum number of keys you'd like
    #   to see
    # * <tt>:delimiter</tt> - Causes keys that contain the same
    #   string between the prefix and the first occurrence of the
    #   delimiter to be rolled up into a single result element
    def find_all(options = {})
      proxy_owner.send(:list_bucket, options)
    end

    # Destroys all keys in the bucket
    def destroy_all
      proxy_target.each { |object| object.destroy }
    end
  end
end

Version data entries

50 entries across 50 versions & 5 rubygems

Version Path
s3-0.3.29 lib/s3/objects_extension.rb
s3-0.3.28 lib/s3/objects_extension.rb
s3-0.3.27 lib/s3/objects_extension.rb
s3-0.3.26 lib/s3/objects_extension.rb
radosgw-s3-1.5 lib/s3/objects_extension.rb
s3-0.3.25 lib/s3/objects_extension.rb
radosgw-s3-1.0 lib/s3/objects_extension.rb
radosgw-s3-0.11 lib/s3/objects_extension.rb
s3-0.3.24 lib/s3/objects_extension.rb
radosgw-s3-0.10 lib/s3/objects_extension.rb
radosgw-s3-0.9 lib/s3/objects_extension.rb
radosgw-s3-0.8 lib/s3/objects_extension.rb
radosgw-s3-0.7 lib/s3/objects_extension.rb
radosgw-s3-0.6 lib/s3/objects_extension.rb
radosgw-s3-0.5 lib/s3/objects_extension.rb
radosgw-s3-0.4 lib/s3/objects_extension.rb
radosgw-s3-0.3 lib/s3/objects_extension.rb
radosgw-s3-0.2 lib/s3/objects_extension.rb
radosgw-s3-0.1 lib/s3/objects_extension.rb
s3-0.3.23 lib/s3/objects_extension.rb