From: Robert Klemme Date: 2007-10-18T04:45:06+09:00 Subject: Re: abstract superclasses On 17.10.2007 21:22, Giles Bowkett wrote: > I sometimes use the Java thing of an abstract superclass in Ruby. I > usually just set up the abstract parent so that it'll break if used > directly. Is it better to just use Modules? Have other people run into > this? Why bother? If your "abstract" class requires a method to be present then just not defining it works pretty well - in modules as well as in classes: irb(main):001:0> o=Object.new.extend Enumerable => # irb(main):002:0> o.map {|y| y.to_i} NoMethodError: undefined method `each' for # from (irb):3:in `map' from (irb):3 from :0 irb(main):003:0> Of course you need some documentation about the missing method - that would probably be the only reason why I'd add a dysfunctional definition of that method... Kind regards robert