Class: Dandy::Config
- Inherits:
-
Object
- Object
- Dandy::Config
- Defined in:
- lib/dandy/config.rb
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(config_file_path) ⇒ Config
constructor
A new instance of Config.
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 |