So, I took a stab at implementing a module for classes which want to 
emulate numerical types.  And eventually I decided that due to Ruby's
dynamic typing, it is possible to be completely general in this 
implementation.  So, I wrote an "Operable" module.

Any class which imports "Operable" must define a method called "lhs".
This will return its value when used as the left-hand side of an
operator expression.  That way, it is easy to make any class usable
in expressions by default:

module Operable
  def [](idx); lhs[idx]; end
  def []=(idx,rhs); lhs[idx]=rhs; end
  def **; rhs ** lhs; end
  def ~; ~lhs; end
  def +@; +lhs; end
  def -@; -lhs; end
  def +(rhs); lhs + rhs; end
  def -(rhs); lhs - rhs; end
  def *(rhs); lhs * rhs; end
  def /(rhs); lhs / rhs; end
  def %(rhs); lhs % rhs; end
  def >>(rhs); lhs >> rhs; end
  def <<(rhs); lhs << rhs; end
  def &(rhs); lhs & rhs; end
  def ^(rhs); lhs ^ rhs; end
  def |(rhs); lhs | rhs; end
  def <=(rhs); lhs <= rhs; end
  def <(rhs); lhs < rhs; end
  def >(rhs); lhs > rhs; end
  def >=(rhs); lhs >= rhs; end
  def <=>(rhs); lhs <=> rhs; end
  def ==(rhs); lhs == rhs; end
  def ===(rhs); lhs === rhs; end
  def =~(rhs); lhs =~ rhs; end
end

Additionally, I wrote another module called "Integerlike" (I couldn't
think of a better name for it), which extends Operable to be
specifically Integerlike by calling the class's to_int method:

module Integerlike
  include Operable
  def lhs; to_int; end
end

My eventual goal is to end up with a module which can be imported into
any class in order to make that class work like a built-in type
(probably will eventually be one module for each of integer, string,
etc.).  Any feedback is welcome.

--Mirian