Class: Dandy::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/dandy/config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_file_path) ⇒ Config

Returns a new instance of Config.



7
8
9
10
11
# File 'lib/dandy/config.rb', line 7

def initialize(config_file_path)
  path = File.join(Dir.pwd, config_file_path)
  yaml = ERB.new(File.read(path)).result
  @params = YAML.load(yaml).deep_symbolize_keys!
end

Instance Method Details

#[](key) ⇒ Object



13
14
15
# File 'lib/dandy/config.rb', line 13

def [](key)
  @params[key]
end