Skip to content

Instantly share code, notes, and snippets.

@aligo
Created June 7, 2012 04:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save aligo/2886630 to your computer and use it in GitHub Desktop.
Save aligo/2886630 to your computer and use it in GitHub Desktop.
def def_scope(name, &block)
singleton_class.send(:define_method, name) do |*args|
klass = clone
klass.instance_eval(block.curry[*args])
klass
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment