Da Streda 08 Februr 2006 19:38 konsu napsal:
> is it a bad programming style in ruby to use 'super' in a module
> definition? that is, is it bad to invoke methods that will be defined in
> the object that will mix in this module?
>
Actually, I'll go a bit further than Jacob and say that is -exactly- what 
mixins are supposed to do - enhance the functionality by providing some extra 
methods that build on existing class functionality. Mixins that are 
completely independent from the class would best be separated into 
stand-alone classes in the most cases.

As far as instance variables go, I tend to avoid making stateful mixins 
myself, and prefer using accessor methods instead of directly accessing the 
including class. I could go on about decoupling logic in here, but it pretty 
much boils down to a matter of taste / religion.

David Vallner