Jan Svitok wrote:
> module A
>  module M
>   module ClassMethods
>     def some_method
>       #...
>     end
>
>   def included(c)
>     c.extend(ClassMethods)
>   end
>  end
> end

The extra ClassMethods module is needed because self methods of a
module are never mixed into the lookup flow. See note #3 at
http://phrogz.net/RubyLibs/RubyMethodLookupFlow.png - using 'extend'
instead of 'include' causes the left end of the mixed-in module line to
come from the 'class methods' side of the extended class, but doesn't
change that the right end always points to the 'instance' methods of
the module.

(Right?)