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
412 413 414 415 416 |
# File 'lib/scout_apm/config.rb', line 412 def any_keys_found? KNOWN_CONFIG_OPTIONS.any? { |option| ENV.has_key?(key_to_env_key(option)) } end |
#has_key?(key) ⇒ Boolean
404 405 406 |
# File 'lib/scout_apm/config.rb', line 404 def has_key?(key) ENV.has_key?(key_to_env_key(key)) end |
#key_to_env_key(key) ⇒ Object
408 409 410 |
# File 'lib/scout_apm/config.rb', line 408 def key_to_env_key(key) 'SCOUT_' + key.upcase end |
#name ⇒ Object
418 419 420 |
# File 'lib/scout_apm/config.rb', line 418 def name "environment" end |
#value(key) ⇒ Object
399 400 401 402 |
# File 'lib/scout_apm/config.rb', line 399 def value(key) val = ENV[key_to_env_key(key)] val.to_s.strip.length.zero? ? nil : val end |