Class: Spellr::ConfigLoader
- Inherits:
-
Object
- Object
- Spellr::ConfigLoader
- Defined in:
- lib/spellr/config_loader.rb
Instance Attribute Summary collapse
-
#config_file ⇒ Object
readonly
:nocov:.
Instance Method Summary collapse
- #[](value) ⇒ Object
-
#initialize(config_file = ::File.join(Spellr.pwd, '.spellr.yml')) ⇒ ConfigLoader
constructor
A new instance of ConfigLoader.
Constructor Details
#initialize(config_file = ::File.join(Spellr.pwd, '.spellr.yml')) ⇒ ConfigLoader
Returns a new instance of ConfigLoader.
14 15 16 |
# File 'lib/spellr/config_loader.rb', line 14 def initialize(config_file = ::File.join(Spellr.pwd, '.spellr.yml')) @config_file = config_file end |
Instance Attribute Details
#config_file ⇒ Object (readonly)
:nocov:
12 13 14 |
# File 'lib/spellr/config_loader.rb', line 12 def config_file @config_file end |
Instance Method Details
#[](value) ⇒ Object
18 19 20 21 |
# File 'lib/spellr/config_loader.rb', line 18 def [](value) load_config unless defined?(@config) @config[value] end |