Created
June 2, 2011 10:03
-
-
Save pupca/1004200 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@available_settings = YAML::load(File.open("#{RAILS_ROOT}/config/settings.yml")) | |
@@available_settings.each do |name, params| | |
src = <<-END_SRC | |
def self.#{name} | |
self[:#{name}] | |
end | |
def self.#{name}? | |
self[:#{name}].to_i > 0 | |
end | |
def self.#{name}=(value) | |
self[:#{name}] = value | |
end | |
END_SRC | |
Seeting.class_eval src |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment