Sha256: cc552f541566987e1aa0ae56c2907a4935222822af3197a968104400e6e07238

Contents?: true

Size: 798 Bytes

Versions: 39

Compression:

Stored size: 798 Bytes

Contents

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

39 entries across 37 versions & 3 rubygems

Version Path
fog-aws-3.1.0 lib/fog/aws/models/storage/versions.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-aws-2.0.1/lib/fog/aws/models/storage/versions.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-aws-2.0.1/lib/fog/aws/models/storage/versions.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-aws-2.0.1/lib/fog/aws/models/storage/versions.rb
fog-aws-3.0.0 lib/fog/aws/models/storage/versions.rb
fog-aws-2.0.1 lib/fog/aws/models/storage/versions.rb
fog-aws-2.0.0 lib/fog/aws/models/storage/versions.rb
fog-aws-1.4.1 lib/fog/aws/models/storage/versions.rb
fog-aws-1.4.0 lib/fog/aws/models/storage/versions.rb
fog-aws-1.3.0 lib/fog/aws/models/storage/versions.rb
fog-aws-1.2.1 lib/fog/aws/models/storage/versions.rb
fog-aws-1.2.0 lib/fog/aws/models/storage/versions.rb
fog-aws-1.1.0 lib/fog/aws/models/storage/versions.rb
fog-aws-1.0.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.13.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.12.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.11.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.10.0 lib/fog/aws/models/storage/versions.rb
fog-aws-0.9.4 lib/fog/aws/models/storage/versions.rb
fog-aws-0.9.3 lib/fog/aws/models/storage/versions.rb