Skip to content

Instantly share code, notes, and snippets.

@wteuber
Last active August 29, 2015 14:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wteuber/02ba17b5e32e496f533b to your computer and use it in GitHub Desktop.
Save wteuber/02ba17b5e32e496f533b to your computer and use it in GitHub Desktop.
configurable in ruby modules
module Foo
include ActiveSupport::Configurable
class << self
def configure
yield config
end
end
end
Foo.configure do |config|
config.bar = 'buz'
end
Foo.config.great = :stuff
Foo.config.bar # => "buz"
Foo.config.great # => :stuff
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment