Class: RubyRabbitmqJanus::Tools::Env

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/rrj/tools/env.rb

Overview

Class for tools used in gem :reek:UtilityFunction

Instance Method Summary collapse

Instance Method Details

#test_env_var(configuration, key) ⇒ Object

Test if a string contains a word ENV



12
13
14
15
16
17
18
19
# File 'lib/rrj/tools/env.rb', line 12

def test_env_var(configuration, key)
  test = configuration[key.to_s]
  if test.is_a?(String)
    test.include?('ENV') ? ENV[test.gsub("ENV['", '').gsub("']", '')] : test
  else
    test
  end
end