Created
April 11, 2017 20:08
-
-
Save nativestranger/6978024cdc344a38509b921db9d354f0 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
class Config4 | |
def self.config4(name) | |
config = Rails.application.config_for(name) | |
Class.new do | |
config.each_pair do |key, value| | |
define_singleton_method(key) { value } | |
define_singleton_method("#{key}=") do |new_value| | |
define_singleton_method(key) { new_value } | |
end | |
end | |
end | |
end | |
class Facebook < config4(:facebook); end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment