Sorry if my answer was a bit air-headed.  Here's a more tangible example:

    class HoursMinutes
      attr_accessor :hours
      attr_reader :minutes
      def initialize h,m
        @hours = h
        self.minutes = m
      end
      def <=> o
        r = (@hours <=> o.hours)
        r = (@minutes <=> o.minutes) if r == 0
        r
      end
      def succ
        HoursMinutes.new(@hours, @minutes+1)
      end
      def minutes= m
        while m > 60
          @hours += 1
          m -= 60
        end
        while m < 0
          @hours -= 1
          m += 60
        end
        @minutes = m
      end
      def to_s
        "%d:%02d" % [@hours, @minutes]
      end
    end

    range = HoursMinutes.new(8,0)..HoursMinutes.new(9,0)
    p range.to_a

The spaceship operator will break if `o` doesn't quack like an
HoursMinutes object, and it's not very useful, but it might be a
decent starting place.

On 13 September 2012 21:37, Matthew Kerwin <matthew / kerwin.net.au> wrote:
> I'd create a class, maybe `class HoursMinutes`, which has @hour and
> @minute properties, defines a #<=> comparison method and a #succ that
> increments @minute with overflow into @hour.  Then I'd make the range
> `HoursMinutes.new(8,0)..HoursMinutes.new(9,0)`
>
> But that's just me.
>
> On 13 September 2012 21:31, Jermaine O. <lists / ruby-forum.com> wrote:
>> Hello everybody,
>>
>> I'm looking for a way to create an array out of a range, but does the
>> counting as like it's a time object. So for instance:
>>
>> (800..900).to_a (which represents: 08:00 - 09:00)
>> will generate an array something like this:
>>
>> #=> [800,801,802,...... 899, 900]
>>
>> Whereas I would like the output to be like this:
>>
>> #=> [800,801,802,...... 859, 900]
>>
>> Basically it should bump to the next major number (hour) after 59
>> instead of going all the way up to 99.
>>
>> How should I go about doing this?
>>
>> Thanks!
>>
>> --
>> Posted via http://www.ruby-forum.com/.
>>
>
>
>
> --
>   Matthew Kerwin, B.Sc (CompSci) (Hons)
>   http://matthew.kerwin.net.au/
>   ABN: 59-013-727-651
>
>   "You'll never find a programming language that frees
>   you from the burden of clarifying your ideas." - xkcd



-- 
  Matthew Kerwin, B.Sc (CompSci) (Hons)
  http://matthew.kerwin.net.au/
  ABN: 59-013-727-651

  "You'll never find a programming language that frees
  you from the burden of clarifying your ideas." - xkcd