Class: S3Sync::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/s3_sync/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.

Examples:

S3Sync::Configuration.new(:key_id => "mykey123", :key_secret => "secret456", :region => "us-east-1", :bucket => "my-backups", :files => [".bash_profile",".gitconfig"], :secret_phrase => "my-s3cr3t")

Parameters:

  • options (Hash) (defaults to: {})

    @option options [String] :key_id The “Access Key Id” for your s3 user @option options [String] :key_secret The “Access Key Secret” for your s3 user @option options [String] :region The s3 region @option options [String] :bucket The s3 bucket (top-level directory) name @option options [String] :secret_phrase The encryption phrase to use when uploading (encrypting) and downloading (decrypting) files @option options [Array] :downloads_dir A staging directory to house files downloaded from s3 @option options [Array] :files A list of local file paths



16
17
18
19
20
21
22
23
24
# File 'lib/s3_sync/configuration.rb', line 16

def initialize(options = {})
  @key_id = options[:key_id]
  @key_secret = options[:key_secret]
  @secret_phrase = options[:secret_phrase]
  @bucket = options[:bucket]
  @region = options[:region]
  @downloads_dir = options[:downloads_dir] || File.join(Dir.home,"Desktop","s3-downloads")
  @files = options[:files]
end

Instance Attribute Details

#bucketObject

Returns the value of attribute bucket.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def bucket
  @bucket
end

#downloads_dirObject

Returns the value of attribute downloads_dir.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def downloads_dir
  @downloads_dir
end

#filesObject

Returns the value of attribute files.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def files
  @files
end

#key_idObject

Returns the value of attribute key_id.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def key_id
  @key_id
end

#key_secretObject

Returns the value of attribute key_secret.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def key_secret
  @key_secret
end

#regionObject

Returns the value of attribute region.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def region
  @region
end

#secret_phraseObject

Returns the value of attribute secret_phrase.



3
4
5
# File 'lib/s3_sync/configuration.rb', line 3

def secret_phrase
  @secret_phrase
end