Class: Smith::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/smith/config.rb

Defined Under Namespace

Classes: ConfigHash

Constant Summary collapse

CONFIG_FILENAME =
'smithrc'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



22
23
24
# File 'lib/smith/config.rb', line 22

def initialize
  load_config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



34
35
36
# File 'lib/smith/config.rb', line 34

def method_missing(method, *args)
  @config.send(method, *args)
end

Class Method Details

.getObject



38
39
40
# File 'lib/smith/config.rb', line 38

def self.get
  @config ||= Config.new
end

Instance Method Details

#pathObject



30
31
32
# File 'lib/smith/config.rb', line 30

def path
  @config_file
end

#reloadObject



26
27
28
# File 'lib/smith/config.rb', line 26

def reload
  @config = Config.new
end