Class: SecretStore::Reader

Inherits:
Object
  • Object
show all
Defined in:
lib/secret_store/reader.rb

Overview

Reader reads a configuration with a given name. Configuration is read in following order, first match is returned

  1. Environment variable

  2. Property File

Class Method Summary collapse

Class Method Details

.read(name) ⇒ Object

If the given name exists as environment variable it will returned otherwise it tries to find the given name as property in the sceret files described in SECRET_FILE_PATH environment variable.



13
14
15
16
# File 'lib/secret_store/reader.rb', line 13

def read(name)
    str = name.to_s
    env?(str) ? ENV[str] : properties[str]            
end