Class: SecretConfig
- Inherits:
-
Object
- Object
- SecretConfig
- Defined in:
- lib/apollo_commons_ruby/SecretConfig.rb
Instance Attribute Summary collapse
-
#authToken ⇒ Object
readonly
Returns the value of attribute authToken.
Instance Method Summary collapse
-
#initialize(environment) ⇒ SecretConfig
constructor
A new instance of SecretConfig.
Constructor Details
#initialize(environment) ⇒ SecretConfig
Returns a new instance of SecretConfig.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/apollo_commons_ruby/SecretConfig.rb', line 5 def initialize(environment) conf_file = File.read(File.("/var/jenkins_home/template_config/config.json")); conf = JSON.parse conf_file conf = conf[environment.downcase] if (conf["authToken"] == nil) puts "Security configurations are missing" return nil end @authToken = conf["authToken"] end |
Instance Attribute Details
#authToken ⇒ Object (readonly)
Returns the value of attribute authToken.
3 4 5 |
# File 'lib/apollo_commons_ruby/SecretConfig.rb', line 3 def authToken @authToken end |