Skip to content

Instantly share code, notes, and snippets.

@nativestranger
Created April 11, 2017 20:08
Show Gist options
  • Save nativestranger/6978024cdc344a38509b921db9d354f0 to your computer and use it in GitHub Desktop.
Save nativestranger/6978024cdc344a38509b921db9d354f0 to your computer and use it in GitHub Desktop.
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