Skip to content

Instantly share code, notes, and snippets.

@ratnikov
Created September 23, 2008 16:50
Show Gist options
  • Save ratnikov/12332 to your computer and use it in GitHub Desktop.
Save ratnikov/12332 to your computer and use it in GitHub Desktop.
module Foo
module_function
def make_foo_mod
foo_closure = "omgwtfBBQ"
Module.new do
def foo_class_var; foo_closure end
def foo_class_var= stuff; foo_closure = stuff end
end
end
end
class Alpha
include Foo.make_foo_mod
end
class Beta
include Foo.make_foo_mod
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment