Pit Capitain
2/15/2009 2:50:00 PM
2009/2/15 Trans <transfire@gmail.com>:
> Great. However, I also want the end-user of this library to be able
> effect all classes and modules with a single extend (or include) as
> well, if they so choose. Eg.
>
> class Module
> include MyEnhancement
> end
Is the problem here that Module defines its own #attr_accessor
shadowing the new one?
> It would also be nice if the module's methods can be made to work from
> the toplevel (main):
>
> extend MyEnhancement
What should #attr_accessor do in the context of the toplevel object?
Maybe you can show us another example?
> In attempting to implement this, I have found myself resorting to
> unDRY, ugly, hacky code, that always seems to have a bug in it
> somewhere. It's infuriating. This is not how programming Ruby is
> supposed to be!
Hmm, I think this will be hacky indeed.
Regards,
Pit