Skip to content

Instantly share code, notes, and snippets.

@jlogsdon
Created June 14, 2012 21:46
Show Gist options
  • Save jlogsdon/2933169 to your computer and use it in GitHub Desktop.
Save jlogsdon/2933169 to your computer and use it in GitHub Desktop.
class Configotron
cattr_accessor :configs
def self.load(file)
key = File.basename(file).gsub(/\..*$/, '')
configs[key] = YAML.load(file) # or whatever
end
def self.method_missing(key, *args)
configs[key] || super(key, *args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment