I’m not sure what you mean; I only see one #something method.
In any case, ugly or not, I think it’s worth knowing about
Module#include if one is interested in this question of class
vs. instance method definition in included modules – especially
because the techniques in question are actually somewhat different
from each other, in their effects (i.e., one isn’t just a wordier
drop-in replacement for the other). With the override of
Module#included, every class that includes this module gets the new
method. So if one wants to break it out with more granularity, one
probably doesn’t want to do it this way at all.
I think he meant that you’re defining #something
separately in each class, instead of having a
pointer back to the Module where it’s defined only
once, although I’m not really sure how that’s uglier
or how it would make any practical difference.
That’s the only way I could make sense of that
statement, though.
I’m not sure what you mean; I only see one #something method.
In any case, ugly or not, I think it’s worth knowing about
Module#include if one is interested in this question of class
vs. instance method definition in included modules – especially
because the techniques in question are actually somewhat different
from each other, in their effects (i.e., one isn’t just a wordier
drop-in replacement for the other). With the override of
Module#included, every class that includes this module gets the new
method. So if one wants to break it out with more granularity, one
probably doesn’t want to do it this way at all.
I think he meant that you’re defining #something
separately in each class, instead of having a
pointer back to the Module where it’s defined only
once, although I’m not really sure how that’s uglier
or how it would make any practical difference.
OK, I see. All the more do they qualify as different techniques
I’m not coming up with a brilliant example… but definitely the
Module#included approach would be appropriate if you want each class
that gets the method to have a different version of the method,
perhaps one that reflects the current state of the program. (Like I
said, no brilliant examples, but anyway