Class: EncbsConfig
- Inherits:
-
Object
- Object
- EncbsConfig
- Defined in:
- lib/encbsconfig.rb
Instance Attribute Summary collapse
-
#bucket ⇒ Object
readonly
Returns the value of attribute bucket.
-
#colorize ⇒ Object
readonly
Returns the value of attribute colorize.
-
#compression ⇒ Object
readonly
Returns the value of attribute compression.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#increment ⇒ Object
readonly
Returns the value of attribute increment.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#paths ⇒ Object
readonly
Returns the value of attribute paths.
-
#purge ⇒ Object
readonly
Returns the value of attribute purge.
-
#secret ⇒ Object
readonly
Returns the value of attribute secret.
-
#size ⇒ Object
readonly
Returns the value of attribute size.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#token ⇒ Object
readonly
Returns the value of attribute token.
-
#verbose ⇒ Object
readonly
Returns the value of attribute verbose.
Instance Method Summary collapse
- #add(attr) ⇒ Object
- #aws_bucket(attr) ⇒ Object
- #aws_key(attr) ⇒ Object
- #aws_secret(attr) ⇒ Object
- #colorize! ⇒ Object
- #increment! ⇒ Object
-
#initialize ⇒ EncbsConfig
constructor
A new instance of EncbsConfig.
- #key_size(attr) ⇒ Object
- #load(path) ⇒ Object
- #public_key(attr) ⇒ Object
- #purge! ⇒ Object
- #set_timeout(attr) ⇒ Object
- #use_compression(attr) ⇒ Object
- #use_hostname(attr) ⇒ Object
- #verbose! ⇒ Object
Constructor Details
#initialize ⇒ EncbsConfig
Returns a new instance of EncbsConfig.
5 6 7 |
# File 'lib/encbsconfig.rb', line 5 def initialize @paths = "" end |
Instance Attribute Details
#bucket ⇒ Object (readonly)
Returns the value of attribute bucket.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def bucket @bucket end |
#colorize ⇒ Object (readonly)
Returns the value of attribute colorize.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def colorize @colorize end |
#compression ⇒ Object (readonly)
Returns the value of attribute compression.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def compression @compression end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def hostname @hostname end |
#increment ⇒ Object (readonly)
Returns the value of attribute increment.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def increment @increment end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def key @key end |
#paths ⇒ Object (readonly)
Returns the value of attribute paths.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def paths @paths end |
#purge ⇒ Object (readonly)
Returns the value of attribute purge.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def purge @purge end |
#secret ⇒ Object (readonly)
Returns the value of attribute secret.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def secret @secret end |
#size ⇒ Object (readonly)
Returns the value of attribute size.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def size @size end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def timeout @timeout end |
#token ⇒ Object (readonly)
Returns the value of attribute token.
2 3 4 |
# File 'lib/encbsconfig.rb', line 2 def token @token end |
#verbose ⇒ Object (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 |