Module: App::Config::Base

Included in:
App::Config
Defined in:
lib/app/config/base.rb

Instance Method Summary collapse

Instance Method Details

#new(*args, **opts) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/app/config/base.rb', line 11

def new( *args, **opts )
  type  =  args.shift || :YAML
  case  type.to_sym
  when  :RUBY
    App::Config::RUBY.new( **opts )
  when  :YAML
    App::Config::YAML.new( **opts )
  when  :JSON
    App::Config::JSON.new( **opts )
  else
    raise  App::Config::Error, "unknown type: #{type}"
  end
end