Class: George::Config

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Config

Returns a new instance of Config.



4
5
6
# File 'lib/george/config.rb', line 4

def initialize(path)
  @data = YAML.load_file(path)
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



8
9
10
11
12
# File 'lib/george/config.rb', line 8

def method_missing(name)
  name = name.to_s
  return nil unless @data.include?(name)
  ENV['GEORGE_' + name.upcase] || @data[name]
end