From: Clifford Heath Date: 2008-02-13T07:04:56+09:00 Subject: Re: Subclassing Integer; solved! Rick DeNatale wrote: > The point is that Year.new isn't returning a Year which looks like a > Fixnum, it IS returning a Fixnum. No, that's not true, it's returning an Integer::BoxedInteger. Year.new(2008).class is being forwarded by the method_missing, simply fixed. However... > Well this doesn't do it. Using the above code but adding a method to Year. ... > Year.new(2008).foo # => > # ~> -:18:in `send': undefined method `foo' for 2008:Fixnum (NoMethodError) > # ~> from -:18:in `method_missing' > # ~> from -:35 Hmmm, that is a bigger problem :-). Probably showstopper in fact, unless I make it into a really *big* ugly hack. It'd be nice if it was possible, but it seems it would have to be done inside Ruby.