From: "Hal E. Fulton" Date: 2002-08-06T18:12:39+09:00 Subject: Re: Writing a method that's added to both Fixnum and Bignum ----- Original Message ----- From: "Harry Ohlsen" To: "ruby-talk ML" Sent: Tuesday, August 06, 2002 3:46 AM Subject: Writing a method that's added to both Fixnum and Bignum > 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. > > The only way I could think of to do this was something like ... (snip and snip) Hmmm. Maybe define a module with nothing but that in it and include it in both places? > But I can't think of how I would coerce the Fixnum into a Bignum. Nor can I offhand. I never stopped to realize till now that Bignum does not have a 'new' method. Hal