Re-Include Module

Posted by Nino55 on Stack Overflow See other posts from Stack Overflow or by Nino55
Published on 2010-04-18T23:06:34Z Indexed on 2010/04/18 23:13 UTC
Read the original article Hit count: 309

Filed under:
|

Hello,

I need some like this:

module One
  def test; puts 'Test One'; end
end

module Two
  def test; puts 'Test Two'; end
end

class Foo
  include One
  include Two
  include One
end

In this case I need as a result 'Test One' but obviously it returns 'Test Two'. I need a clean simple way for re-include my module.

Any suggestion?

Thanks!

© Stack Overflow or respective owner

Related posts about ruby

Related posts about metaprogramming