From: Justin Johnson Date: 2002-08-06T22:01:11+09:00 Subject: Re: Writing a method that's added to both Fixnum and Bignum Or if you don't want to put it in Integer put your method into a module and include it into Fixnum and Bignum: module MyCode def nice_method p "hello" end end class Fixnum include MyCode end class Bignum include MyCode end -- Justin Johnson "Tom Sawyer" wrote in message news:1028626025.21930.940.camel@silver... > On Tue, 2002-08-06 at 02:46, Harry Ohlsen wrote: > > A mate of mine just asked me an interesting question. He had written a method > > that extended Fixnum and then realised that he wanted it to work for Bignum > > as well, but the code is obviously identical. > > they both inherit from integer. can you put it there? > > -- > ~transami