Method: Yacl::Loader::Env#initialize
- Defined in:
- lib/yacl/loader/env.rb
#initialize(opts = {}) ⇒ Env
Create a new Env instance from the loaded options
opts - a hash of options:
:env => The environment has to pass in (default: ENV). required.
:prefix => the prefix to strip off of each key in the :env hash. required.
28 29 30 31 32 33 |
# File 'lib/yacl/loader/env.rb', line 28 def initialize( opts = {} ) super @env = @options.fetch( :env, ENV ) @prefix = @options.fetch( :prefix, nil ) raise Error, "No environment variable prefix is given" unless @prefix end |