Class: Spellr::ConfigLoader
- Inherits:
-
Object
- Object
- Spellr::ConfigLoader
- Defined in:
- lib/spellr/config_loader.rb
Instance Attribute Summary collapse
-
#config_file ⇒ Object
Returns the value of attribute config_file.
Instance Method Summary collapse
- #[](value) ⇒ Object
-
#initialize(config_file = ::File.join(Dir.pwd, '.spellr.yml')) ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
Constructor Details
#initialize(config_file = ::File.join(Dir.pwd, '.spellr.yml')) ⇒ ConfigLoader
Returns a new instance of ConfigLoader.
9 10 11 |
# File 'lib/spellr/config_loader.rb', line 9 def initialize(config_file = ::File.join(Dir.pwd, '.spellr.yml')) @config_file = config_file end |
Instance Attribute Details
#config_file ⇒ Object
Returns the value of attribute config_file.
7 8 9 |
# File 'lib/spellr/config_loader.rb', line 7 def config_file @config_file end |
Instance Method Details
#[](value) ⇒ Object
20 21 22 23 |
# File 'lib/spellr/config_loader.rb', line 20 def [](value) load_config unless @config @config[value] end |