Sha256: c7346a6f3bd1e8c931041025718e1b5468ca937524a11ffa37c7ff59138c5d68

Contents?: true

Size: 828 Bytes

Versions: 22

Compression:

Stored size: 828 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/models/storage/version'

module Fog
  module Storage
    class AWS
      class Versions < Fog::Collection
        attribute :file
        attribute :directory

        model Fog::Storage::AWS::Version

        def all(options = {})
          data = if file
            service.get_bucket_object_versions(file.directory.key, options.merge('prefix' => file.key)).body['Versions']
          else
            service.get_bucket_object_versions(directory.key, options).body['Versions']
          end

          load(data)
        end

        def new(attributes = {})
          version_type = attributes.keys.first

          model = super(attributes[version_type])
          model.delete_marker = version_type == 'DeleteMarker'

          model
        end
      end
    end
  end
end

Version data entries

22 entries across 22 versions & 5 rubygems

Version Path
vagrant-cloudstack-1.1.0 vendor/bundle/gems/fog-1.22.1/lib/fog/aws/models/storage/versions.rb
fog-aws-0.1.1 lib/fog/aws/models/storage/versions.rb
fog-aws-0.1.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.0.8 lib/fog/aws/models/storage/versions.rb
fog-aws-0.0.7 lib/fog/aws/models/storage/versions.rb
fog-aws-0.0.6 lib/fog/aws/models/storage/versions.rb
fog-aws-0.0.5 lib/fog/aws/models/storage/versions.rb
fog-1.26.0 lib/fog/aws/models/storage/versions.rb
fog-1.25.0 lib/fog/aws/models/storage/versions.rb
nsidc-fog-1.24.1 lib/fog/aws/models/storage/versions.rb
fog-1.24.0 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.11 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.10 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.9 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.8 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.7 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.6 lib/fog/aws/models/storage/versions.rb
fog-1.23.0 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.4 lib/fog/aws/models/storage/versions.rb
ns-fog-1.22.3 lib/fog/aws/models/storage/versions.rb