From: Eli Bendersky Date: 2007-06-16T15:10:08+09:00 Subject: Re: Abstract interfaces as a means of documentation On Jun 16, 1:53 am, "Gregory Brown" wrote: > On 6/15/07, Eli Bendersky wrote: > > > Is this really different from declaring JumpingClimbingPlayer as a > > class and inheriting the concrete classes from it, like: > > > class FooTypePlayer < JumpingClimbingPlayer > > Yes. Modules cannot be inherited from or instantiated. Understood, thanks. Another thing - say that for some reason I want my classes not to have the default .new constructor, and instead use factory methods (for example, it's important to return values from the factory methods, other than the object). In a normal class, I can say: class Foo private_class_method :new self.create(a, b) ... # do stuff return [new(a, b), message] end private def initialize(a, b) ... end end But if I want a class family adhering to an abstract interface (like the previous posts show), how can I do that with a Module ? Module doesn't allow the "private_class_method" line since it doesn't have a :new method. With an abstract base Class (instead of Module) it *is* possible, isn't it ? Eli