Class: ScoutApm::Config::ConfigEnvironment
- Inherits:
-
Object
- Object
- ScoutApm::Config::ConfigEnvironment
- Defined in:
- lib/scout_apm/config.rb
Instance Method Summary collapse
- #any_keys_found? ⇒ Boolean
- #has_key?(key) ⇒ Boolean
- #key_to_env_key(key) ⇒ Object
- #name ⇒ Object
- #value(key) ⇒ Object
Instance Method Details
#any_keys_found? ⇒ Boolean
336 337 338 339 340 |
# File 'lib/scout_apm/config.rb', line 336 def any_keys_found? KNOWN_CONFIG_OPTIONS.any? { |option| ENV.has_key?(key_to_env_key(option)) } end |
#has_key?(key) ⇒ Boolean
328 329 330 |
# File 'lib/scout_apm/config.rb', line 328 def has_key?(key) ENV.has_key?(key_to_env_key(key)) end |
#key_to_env_key(key) ⇒ Object
332 333 334 |
# File 'lib/scout_apm/config.rb', line 332 def key_to_env_key(key) 'SCOUT_' + key.upcase end |
#name ⇒ Object
342 343 344 |
# File 'lib/scout_apm/config.rb', line 342 def name "environment" end |
#value(key) ⇒ Object
323 324 325 326 |
# File 'lib/scout_apm/config.rb', line 323 def value(key) val = ENV[key_to_env_key(key)] val.to_s.strip.length.zero? ? nil : val end |