From: "David A. Black" Date: 2004-05-14T20:03:57+09:00 Subject: Re: range problem Hi -- On Fri, 14 May 2004, Rasputin wrote: > >From the Pickaxe book: > > class VU > include Comparable > > attr :volume > > def initialize(volume) # 0..9 > @volume = volume > end > > def inspect > '#' * @volume > end > > # Support for ranges > def <=>(other) > self.volume <=> other.volume > end > > def succ > raise(IndexError, "Volume too big") if @volume >= 9 Should that be > rather than >= ? David -- David A. Black dblack@wobblini.net