Module: Settings

Extended by:
Settings
Included in:
Settings
Defined in:
lib/settings.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object



18
19
20
21
# File 'lib/settings.rb', line 18

def method_missing(name, *args, &block)
  @_settings.with_indifferent_access[name.to_sym] ||
  fail(NoMethodError, "unknown configuration root #{name}", caller)
end

Instance Method Details

#load!(options = {}) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/settings.rb', line 8

def load!(options={})
  @_settings = YAML::load(ERB.new(Rails.root.join("config", "ar_report.yml").read).result).with_indifferent_access
  @_settings = newsets[options[:env].to_sym] if \
                                             options[:env] && \
                                             newsets[options[:env].to_sym]

end