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

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