Created
August 17, 2015 17:19
-
-
Save gerep/40b27c35c43be3c9ff50 to your computer and use it in GitHub Desktop.
This file contains 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
# READS A .yml FILE AND FOR EACH KEY IT WILL CREATE A GETTER AND SETTER METHODS | |
class Flag | |
def initialize | |
@yaml = Psych.load_file('config/flags.yml') | |
@yaml.each_key do |item| | |
self.class.send(:define_method, item) { @yaml[item] } | |
self.class.send(:define_method, "#{item}=") { |value| @yaml[item] = value } | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment