Class: Spellr::ConfigLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/spellr/config_loader.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_fileObject (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