Class: Chamber::DecryptionKey

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

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ DecryptionKey

Returns a new instance of DecryptionKey.



5
6
7
8
# File 'lib/chamber/decryption_key.rb', line 5

def initialize(options = {})
  self.rootpath = options[:rootpath]
  self.filename = options[:filename] || ''
end

Class Method Details

.resolve(*args) ⇒ Object



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

def self.resolve(*args)
  new(*args).resolve
end

Instance Method Details

#resolveObject



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

def resolve
  if filename.readable?
    filename.read
  elsif in_environment_variable?
    environment_variable
  end
end