Lionel Thiry
12/29/2004 4:18:00 PM
> module Foo
> def foo
> puts "foo called"
> end
> end
>
> class MyClass
> class << self
> def include(*args)
> include *args
> end
> end
> def try_include
> self.class.include Foo
> puts "included Foo"
> self.foo
> end
> end
In the normal ruby way to do things, you should replace
"self.class.include Foo" by "self.extend Foo".
But, yes, leaking on self.class.include is a bug. If it must not be
possible, it should raise an exception instead.
Lionel Thiry