public
Created — forked from carlosantoniodasilva/config.rb

Simple config class

  • Download Gist
config.rb
Ruby
1 2 3 4 5 6 7 8 9 10 11
## Simple config class - testing purposes =)
 
FooConfig = Class.new do
def initialize(config_file, env)
@config = YAML.load_file(config_file)[env]
end
 
def method_missing(method, *args)
@config.send(:[], method.to_s, *args)
end
end.new('config/foo.yml', Rails.env)

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.