On Oct 12, 1:25 pm, "ara.t.howard" <ara.t.how... / gmail.com> wrote:
> On Oct 12, 2007, at 9:40 AM, Brian Adkins wrote:
> > Actually, what you want is simply N. It's a nonsensical request from a
> > troll. Using max, end, last, etc. to find the end of the range is
> > ridiculous since you must know the end of the range to define the
> > range!
>
> that is not true.  any object can be used in a range in ruby.  it
> only must respond to #succ.  it's quite possible to declare classes
> that worked like so

I'm not unfamiliar with the domain of the Range class. Let's not get
ridiculous here; I was referring specifically to integer ranges.
Nothing unambiguates like code, eh? :)

class Range
  def max_int
    raise 'invalid range' if self.end < self.begin
    self.end - (self.exclude_end? ? 1 : 0)
  end
end