From: Clifford Heath Date: 2008-02-13T08:44:58+09:00 Subject: Re: Subclassing Integer; solved! Clifford Heath wrote: > It'd be nice if it was possible... This seems to work, requiring only a minimal adjustment by callers to subclass Int instead of Integer: class Int def initialize(i) @__value = i.to_i end private attr_accessor :__value def method_missing(meth, *args, &block) @__value.send meth, *args, &block end public alias __respond_to respond_to? def respond_to?(m, p = false) __respond_to(m, p) || @__value.respond_to?(m, p) end end Clifford Heath.