Class: Honeybadger::Config::Env
- Inherits:
-
Hash
- Object
- Hash
- Honeybadger::Config::Env
- Defined in:
- lib/honeybadger/config/env.rb
Constant Summary collapse
- CONFIG_KEY =
/\AHONEYBADGER_(.+)\Z/.freeze
- CONFIG_MAPPING =
Hash[DEFAULTS.keys.map {|k| [k.to_s.upcase.gsub(KEY_REPLACEMENT, '_'), k] }].freeze
- ARRAY_VALUES =
Regexp.new('\s*,\s*').freeze
Instance Method Summary collapse
-
#initialize(env = ENV) ⇒ Env
constructor
A new instance of Env.
Constructor Details
#initialize(env = ENV) ⇒ Env
Returns a new instance of Env.
8 9 10 11 12 13 14 |
# File 'lib/honeybadger/config/env.rb', line 8 def initialize(env = ENV) env.each_pair do |k,v| next unless k.match(CONFIG_KEY) next unless config_key = CONFIG_MAPPING[$1] self[config_key] = cast_value(v, OPTIONS[config_key][:type]) end end |