Skip to content

Instantly share code, notes, and snippets.

@tomlea
Forked from lazyatom/gist:217001
Created October 26, 2009 23:31
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 tomlea/219144 to your computer and use it in GitHub Desktop.
Save tomlea/219144 to your computer and use it in GitHub Desktop.
module Behaviour
def child_class
Child
end
end
module Family
class Child; end
class Sibling
behaviour = Behaviour.clone
behaviour.send(:define_method, :const_missing, method(:const_get))
include behaviour
end
end
p Family::Sibling.new.child_class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment