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.



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

def initialize
  load_config
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



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

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

Class Method Details

.getObject



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

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

Instance Method Details

#pathObject



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

def path
  @config_file
end

#reloadObject



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

def reload
  @config = Config.new
end