I've updated the gist a bit to reflect what you found about moving the
class decoration below the module A reopening.

This is just really baffling =(

For a concrete example, if I wrote an extension module SuperEnum to
Enumerable and wanted all objects that included Enumerable to have access
to this extension, I would expect that I could open up the module
Enumerable and include module SuperEnum.


On Fri, Jan 18, 2013 at 5:35 AM, jake kaiden <lists / ruby-forum.com> wrote:

> hmmm...
>
>   not sure what's going on there, i'd expect the same behavior that you
> do.  you've probably already found ways to work around this, but if not,
> both of these work:
>
> module A
>   def foo1; end
> end
>
> module B
>   def foo2; end
> end
>
> module A
>   include B
>   def foo3; end
> end
>
> class Klass
>   include A
> end
>
> p Klass.instance_methods
>
> **** or ****
>
> module A
>   def foo1; end
> end
>
> class Klass
>   include A
> end
>
> module B
>   def foo2; end
> end
>
> class Klass
>   include B
> end
>
> module A
>   def foo3; end
> end
>
> p Klass.instance_methods
>
>   wish i could explain (and understand!) why your original example
> doesn't work as expected...
>
>  - j
>
> --
> Posted via http://www.ruby-forum.com/.
>
>


-- 
Incoherently,
Ricky Ng