On Tue, 11 Apr 2006, Daniel Berger wrote:

> I'm coming into this thread late, but I think I'm missing something here. 
> What's wrong with this?
>
> module Foo
>   attr_accessor :meth_a
> end
>
> class Bar
>   include Foo
>   extend Foo
> end
>
> p Bar.meth_a # nil
> Bar.meth_a = 'test'
> p Bar.meth_a # 'test'
>
> bar = Bar.new
> p bar.meth_a # nil
> bar.meth_a = 'test'
> p bar.meth_a # 'test'
>
> Regards,
>
> Dan

nothing at all.  i just tend to forget

   extend Foo

later in my code.

plus it can violate dry when you start doing

   class Button
     include Colors
     extend Colors
   end

   class Window
     include Colors
     extend Colors
   end

   class Panel
     include Colors
     extend Colors
   end

etc.  easier to do

   module Colors
     def included
       ...
     end
   end

one time IMHO.  OTOH this might confuse someone.  you certainly right though.

cheers.

-a
-- 
be kind whenever possible... it is always possible.
- h.h. the 14th dali lama