class MSS::S3::BucketVersionCollection

A collection of versioned objects for the entire bucket.

@see PrefixedCollection

Attributes

bucket[R]

@return [Bucket] The bucket this collection belongs to.

Public Class Methods

new(bucket, options = {}) click to toggle source

@param [Bucket] bucket

Calls superclass method
# File lib/mss/s3/bucket_version_collection.rb, line 24
def initialize bucket, options = {}
  @bucket = bucket
  super
end

Public Instance Methods

each(options = {}) click to toggle source

Yields once for each version in the bucket.

@yield [object_version]

@yieldparam [ObjectVersion] object_version

@return nil

Calls superclass method
# File lib/mss/s3/bucket_version_collection.rb, line 47
def each options = {}, █ super; end
latest() click to toggle source

@return [ObjectVersion] Returns the most recently created object

version in the entire bucket.
# File lib/mss/s3/bucket_version_collection.rb, line 34
def latest
  first
  #self.find{|version| true }
end

Protected Instance Methods

each_member_in_page(page) { |object_version| ... } click to toggle source

@api private

# File lib/mss/s3/bucket_version_collection.rb, line 51
def each_member_in_page(page, &block)
  super
  page.versions.each do |version|
    object_version = ObjectVersion.new(bucket.objects[version.key],
                                       version.version_id, 
                                       :delete_marker => version.delete_marker?, 
                                       :last_modified => version.last_modified)
    yield(object_version)
  end
end
limit_param() click to toggle source

@api private

# File lib/mss/s3/bucket_version_collection.rb, line 70
def limit_param; :max_keys; end
list_request(options) click to toggle source

@api private

# File lib/mss/s3/bucket_version_collection.rb, line 64
def list_request(options)
  client.list_object_versions(options)
end
pagination_markers() click to toggle source

@api private

Calls superclass method
# File lib/mss/s3/bucket_version_collection.rb, line 74
def pagination_markers; super + [:version_id_marker]; end