From: Austin Ziegler Date: 2003-04-03T11:22:54+09:00 Subject: Re: [ANN] Uninheritable 1.0 On Thu, 3 Apr 2003 07:15:33 +0900, Mauricio Fern�ndez wrote: > On Thu, Apr 03, 2003 at 05:00:14AM +0900, Austin Ziegler wrote: >> Uninheritable provides a simple way to make a class uninheritable >> (unable to be subclassed from). While the technique to do this is >> not difficult, neither is it immediately obvious, and there is no >> standard exception for this. > Is it like that? > module Uninheritable > def inherited(klass) > raise TypeError > end > end Mostly. It's: module Uninheritable def inherited(klass) raise TypeError, "Class #{self} is unable to be subclassed." end end Like I said, it's very simple. But it's something that I need for the PDF library that I'm working on. -austin -- Austin Ziegler, austin@halostatue.ca on 2003.04.02 at 21:18:43