[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Re: Why Class decls and API docs don't Match

Gavin Kistner

10/18/2006 11:06:00 PM

From: Ken Bloom [mailto:kbloom@gmail.com]
> I nevertheless do not know what the rationale is for not bringing
> along the class methods of a module along with the instance
> methods when
> the module is included in a class.

Not being matz (or nobu or such), I can only guess myself. However, I
prefer it this way, since it means that I can have a module with utility
methods and not have those utility methods spammed into my class when I
include it.

What might be nice, however, would be an "include_and_extend" type class
method that does what you describe, setting up two parallel inheritance
paths for the class methods and instance methods to the module.