Guest User

Untitled

a guest
Jul 20th, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. class Foo
  2. def hello
  3. puts "hello 1"
  4. end
  5. end
  6.  
  7.  
  8.  
  9. module Some
  10. class Foo
  11. def hello
  12. puts "hello 2"
  13. end
  14. end
  15. end
  16.  
  17. include Some
  18.  
  19.  
  20. class Testing < Foo
  21. end
  22.  
  23. m = Testing.new
  24. m.hello #=> "hello 1"
  25.  
  26.  
  27. # why the original Foo class is not monkey patched by the included one?
Add Comment
Please, Sign In to add comment