Class AWS::S3::ObjectVersionCollection
In: lib/aws/s3/object_version_collection.rb
Parent: Object

For S3 buckets with versioning enabled, objects will store versions each time you write to them.

  object = bucket.objects['myobj']
  object.write('1')
  object.write('2')
  object.write('3')

  object.versions.collect(&:read)
  #=> ['1', '2', '3']

If you know the id of a particular version you can get that object.

  bucket.objets['myobj'].version[version_id].delete

Methods

[]   each   latest   new  

Included Modules

Model Enumerable

Attributes

object  [R]  @return [S3Object] The object this collection belongs to.

Public Class methods

Public Instance methods

Returns an object that represents a single version of the {object}. @param [String] version_id @return [ObjectVersion]

Yields once for each version of the {object}.

@yield [object_version] @yieldparam [ObectVersion] object_version @return [nil]

@note Generally you will just want to grab the object key its key. @return [ObjectVersion] Returns the latest version of this object.

[Validate]