Skip to content

Instantly share code, notes, and snippets.

@blasterpal
Created June 14, 2013 16:46
Show Gist options
  • Select an option

  • Save blasterpal/5783463 to your computer and use it in GitHub Desktop.

Select an option

Save blasterpal/5783463 to your computer and use it in GitHub Desktop.
Simple Config object for Rails or Ruby
require 'yaml'
class SSOConfig
class << self
attr_accessor :config
def method_missing(method_name)
config[method_name.to_s]
end
end
end
SSOConfig.config = YAML.load(File.open(File.join(Rails.root,'config/signon.yml')).read)[Rails.env]
# now just access via SSOConfig.<whatever>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment