From: "Jan E." Date: 2012-08-17T02:59:46+09:00 Subject: Re: A Ruby class is never closed What you do mean? A sealed class like in C# which doesn't allow subclasses? Or the singleton pattern where a class can only be instantiated once? You can actually do both. For a sealed/final class you can use the "inherited" hook which gets called every time a new class is derived from this class. If it raises an error, the class is "sealed" (the question is if this makes sense). class A def self.inherited subclass raise "cannot derive from sealed class #{self}" end end # this doesn't work class B < A; end For the singleton pattern, there's the singleton module in the standard library. -- Posted via http://www.ruby-forum.com/.