Skip to content

Instantly share code, notes, and snippets.

@itspriddle
Forked from jmazzi/test.rb
Created January 6, 2012 20:10
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 itspriddle/1572191 to your computer and use it in GitHub Desktop.
Save itspriddle/1572191 to your computer and use it in GitHub Desktop.
module Blah
def configuration
@configuration ||={}
end
def configure(&block)
yield configuration
end
def register_handler(name, &block)
config = configuration.dup
yield config
end
end
module Other
extend Blah
configure do |c|
c[:username] = 'this'
end
register_handler(:other) do |c|
c[:username] = 'blah'
end
p configuration
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment