Path: | lib/more/facets/uninheritable.rb |
Last Update: | Tue Dec 02 09:46:42 -0500 2008 |
Allows an object to declare itself as unable to be subclassed. The technique behind this is very simple (redefinition of inherited), so this just provides an easier way to do the same thing with a consistent error message.
class A extend Uninheritable end class B < A; end # => raises TypeError
Copyright (c) 2003 Austin Ziegler
Ruby License This module is free software. You may use, modify, and/or redistribute this software under the same terms as Ruby. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.