Class: Loquacious::Utility
- Inherits:
-
Object
- Object
- Loquacious::Utility
- Defined in:
- lib/loquacious/utility.rb
Class Method Summary collapse
-
.env_var_name(name, config) ⇒ Object
Returns the variable name to use for a value to be picked from ENV.
Class Method Details
.env_var_name(name, config) ⇒ Object
Returns the variable name to use for a value to be picked from ENV
6 7 8 9 10 11 |
# File 'lib/loquacious/utility.rb', line 6 def env_var_name(name, config) parent_list = config.parent_list parent_part = parent_list.empty? ? nil : parent_list.join("_") key_name = name.to_s.split(".").last [::Loquacious.env_prefix, parent_part, config.__name, key_name].compact.join("_").upcase end |