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.



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

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

Class Method Details

.resolve(*args) ⇒ Object



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

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

Instance Method Details

#resolveObject



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

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