Class: Chamber::Configuration

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
16
17
18
# File 'lib/chamber/configuration.rb', line 9

def initialize(options = {})
  self.basepath       = options[:basepath]        || ''
  self.namespaces     = options[:namespaces]      || []
  self.decryption_key = options[:decryption_key]
  self.encryption_key = options[:encryption_key]
  self.files          = options[:files]           || [
                      self.basepath + 'credentials*.yml',
                      self.basepath + 'settings*.yml',
                      self.basepath + 'settings' ]
end

Instance Attribute Details

#basepathObject

Returns the value of attribute basepath.



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

def basepath
  @basepath
end

#decryption_keyObject

Returns the value of attribute decryption_key.



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

def decryption_key
  @decryption_key
end

#encryption_keyObject

Returns the value of attribute encryption_key.



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

def encryption_key
  @encryption_key
end

#filesObject

Returns the value of attribute files.



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

def files
  @files
end

#namespacesObject

Returns the value of attribute namespaces.



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

def namespaces
  @namespaces
end

Instance Method Details

#to_hashObject



20
21
22
23
24
25
26
27
28
# File 'lib/chamber/configuration.rb', line 20

def to_hash
  {
    basepath:       self.basepath,
    decryption_key: self.decryption_key,
    encryption_key: self.encryption_key,
    files:          self.files,
    namespaces:     self.namespaces,
  }
end