Class: EncbsConfig

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeEncbsConfig

Returns a new instance of EncbsConfig.



5
6
7
# File 'lib/encbsconfig.rb', line 5

def initialize
  @paths = ""
end

Instance Attribute Details

#bucketObject (readonly)

Returns the value of attribute bucket.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def bucket
  @bucket
end

#colorizeObject (readonly)

Returns the value of attribute colorize.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def colorize
  @colorize
end

#compressionObject (readonly)

Returns the value of attribute compression.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def compression
  @compression
end

#hostnameObject (readonly)

Returns the value of attribute hostname.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def hostname
  @hostname
end

#incrementObject (readonly)

Returns the value of attribute increment.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def increment
  @increment
end

#keyObject (readonly)

Returns the value of attribute key.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def key
  @key
end

#pathsObject (readonly)

Returns the value of attribute paths.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def paths
  @paths
end

#purgeObject (readonly)

Returns the value of attribute purge.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def purge
  @purge
end

#secretObject (readonly)

Returns the value of attribute secret.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def secret
  @secret
end

#sizeObject (readonly)

Returns the value of attribute size.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def size
  @size
end

#timeoutObject (readonly)

Returns the value of attribute timeout.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def timeout
  @timeout
end

#tokenObject (readonly)

Returns the value of attribute token.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def token
  @token
end

#verboseObject (readonly)

Returns the value of attribute verbose.



2
3
4
# File 'lib/encbsconfig.rb', line 2

def verbose
  @verbose
end

Instance Method Details

#add(attr) ⇒ Object



22
23
24
# File 'lib/encbsconfig.rb', line 22

def add(attr)
  @paths += " #{attr}"
end

#aws_bucket(attr) ⇒ Object



50
51
52
# File 'lib/encbsconfig.rb', line 50

def aws_bucket attr
  @bucket = attr
end

#aws_key(attr) ⇒ Object



42
43
44
# File 'lib/encbsconfig.rb', line 42

def aws_key attr
  @key = attr
end

#aws_secret(attr) ⇒ Object



46
47
48
# File 'lib/encbsconfig.rb', line 46

def aws_secret attr
  @secret = attr
end

#colorize!Object



26
27
28
# File 'lib/encbsconfig.rb', line 26

def colorize!
  @colorize = true
end

#increment!Object



34
35
36
# File 'lib/encbsconfig.rb', line 34

def increment!
  @increment = true
end

#key_size(attr) ⇒ Object



54
55
56
# File 'lib/encbsconfig.rb', line 54

def key_size attr
  @size = attr
end

#load(path) ⇒ Object



9
10
11
12
13
14
15
16
# File 'lib/encbsconfig.rb', line 9

def load(path)
  [:bucket, :colorize, :compression, :hostname, :increment, :key, :secret,
    :size, :token, :timeout, :verbose].each {|attr| eval "@#{attr} = nil"}

  @paths = ""

  instance_eval "#{open(path).read}"
end

#public_key(attr) ⇒ Object



30
31
32
# File 'lib/encbsconfig.rb', line 30

def public_key attr
  @token = attr
end

#purge!Object



66
67
68
# File 'lib/encbsconfig.rb', line 66

def purge!
  @purge = true unless @increment
end

#set_timeout(attr) ⇒ Object



62
63
64
# File 'lib/encbsconfig.rb', line 62

def set_timeout attr
  @timeout = attr
end

#use_compression(attr) ⇒ Object



38
39
40
# File 'lib/encbsconfig.rb', line 38

def use_compression attr
  @compression = attr
end

#use_hostname(attr) ⇒ Object



18
19
20
# File 'lib/encbsconfig.rb', line 18

def use_hostname attr
  @hostname = attr
end

#verbose!Object



58
59
60
# File 'lib/encbsconfig.rb', line 58

def verbose!
  @verbose = true
end