From: Rick DeNatale Date: 2009-08-26T02:58:37+09:00 Subject: Re: Calling method from another class On Tue, Aug 25, 2009 at 12:53 PM, David Masover wrote: > On Tuesday 25 August 2009 09:43:29 am Nilesh Trivedi wrote: > >> I have a related question. "Class" is a subclass of "Module". Then why >> is it that I can include a Module but not another Class? > > You can include a module because you can include exactly modules, and nothing > else -- just as you can inherit from exactly classes, and nothing else. > > I don't really know why Class is a subclass of Module. I'm guessing there is > some code shared between them, or maybe it makes other things easier to > understand. Class inherits the behavior to act as a namespace, and the ability to hold instance methods from Module. Classes can instantiate instances, Modules cannot. -- Rick DeNatale Blog: http://talklikeaduck.denhaven2.com/ Twitter: http://twitter.com/RickDeNatale WWR: http://www.workingwithrails.com/person/9021-rick-denatale LinkedIn: http://www.linkedin.com/in/rickdenatale