Sha256: a3561df3c49d8da3b5ff0d4bd36f695b6640e36d2f8af577408c5f07f2c1f5b8

Contents?: true

Size: 970 Bytes

Versions: 11

Compression:

Stored size: 970 Bytes

Contents

require 'aws/s3'

module Backup
  module Transfer
    class S3 < Backup::Transfer::Base
    
      def initialize(options)
        super(default_options.merge(options))
        
        # Creates a new instance of the Amazon S3 Wrapper Class/Object
        # Passes in the options hash and lets the wrapper extract only the
        # necessary information that is required to establish a link to Amazon S3.
        s3 = Backup::Connection::S3.new(options)
        
        # Connects to Amazon S3 using the credentials provided and
        # stored in the options has by the user
        s3.connect
        
        # Initializes the file transfer to Amazon S3
        s3.transfer
      end
      
      private
      
        # Set default options
        def default_options
          {:s3 => {
              :access_key_id      => '',
              :secret_access_key  => '',
              :bucket             => ''
            }}
        end
      
    end
  end
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
backup-1.3.4 lib/backup/transfer/s3.rb
backup-1.3.3 lib/backup/transfer/s3.rb
backup-1.3.2 lib/backup/transfer/s3.rb
backup-1.3.1 lib/backup/transfer/s3.rb
backup-1.3.0 lib/backup/transfer/s3.rb
backup-1.2.2 lib/backup/transfer/s3.rb
backup-1.2.1 lib/backup/transfer/s3.rb
backup-1.2.0 lib/backup/transfer/s3.rb
backup-1.1.0 lib/backup/transfer/s3.rb
backup-1.0.0 lib/backup/transfer/s3.rb
backup-0.2.0 lib/backup/transfer/s3.rb