Guest User

Untitled

a guest
Apr 23rd, 2018
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1.  
  2. module Behaviour
  3. def child_class
  4. Child
  5. end
  6. end
  7.  
  8. module Family
  9. class Child; end
  10.  
  11. class Sibling
  12. behaviour = Behaviour.clone
  13. behaviour.send(:define_method, :const_missing, method(:const_get))
  14. include behaviour
  15. end
  16. end
  17.  
  18. p Family::Sibling.new.child_class
Add Comment
Please, Sign In to add comment