Class: Biscuit::SecretsDecrypter
- Inherits:
-
Object
- Object
- Biscuit::SecretsDecrypter
- Defined in:
- lib/biscuit/secrets_decrypter.rb
Instance Attribute Summary collapse
-
#secrets_file ⇒ Object
readonly
Returns the value of attribute secrets_file.
Instance Method Summary collapse
-
#initialize(secrets_file) ⇒ SecretsDecrypter
constructor
A new instance of SecretsDecrypter.
- #load(&block) ⇒ Object
Constructor Details
#initialize(secrets_file) ⇒ SecretsDecrypter
Returns a new instance of SecretsDecrypter.
7 8 9 10 11 |
# File 'lib/biscuit/secrets_decrypter.rb', line 7 def initialize(secrets_file) fail "#{secrets_file} is not found" unless File.exist? secrets_file @secrets_file = secrets_file end |
Instance Attribute Details
#secrets_file ⇒ Object (readonly)
Returns the value of attribute secrets_file.
5 6 7 |
# File 'lib/biscuit/secrets_decrypter.rb', line 5 def secrets_file @secrets_file end |
Instance Method Details
#load(&block) ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/biscuit/secrets_decrypter.rb', line 13 def load(&block) if block_given? secrets.each{ |key, value| block.call(key, value) } else secrets end end |