Skip to content

Instantly share code, notes, and snippets.

@c4milo
Created May 28, 2009 05:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save c4milo/119109 to your computer and use it in GitHub Desktop.
Save c4milo/119109 to your computer and use it in GitHub Desktop.
require 'singleton'
class Configuration
include Singleton
def initialize
config_file = File.join(RAILS_ROOT, "config", "application.yml")
if File.exists?(config_file)
config = YAML.load(File.read(config_file))[RAILS_ENV]
config.keys.each do |key|
attr_accessor key
send "#{key}=", config[key]
end
end
end
end
home/camilo/Development/ontoworks/accounts/ontoworks-accounts/lib/configuration.rb:13:in `initialize': undefined method `attr_accessor' for #<Configuration:0x7fc5a87e16c8> (NoMethodError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment