lib/time_range.rb
def max
    return self.end - 1 if exclude_end?

    super
  end
# Reimplementation of Range#max. TimeRange makes one assumption; that ranges
# excluding end should be one second shorter than those that don't.
#
# Normal Ranges simply TypeError when excluding_end is true. However, since
# Ruby's Time methods assume seconds anyway, it is reasonable to use seconds
# here.
#
# Doing so enables the implementation of a number of useful TimeRange methods.
#
# @return [Time] the highest time included in the range
Reimplementation of Range#max. TimeRange makes one assumption; that ranges
excluding end should be one second shorter than those that don't.

Normal Ranges simply TypeError when excluding_end is true. However, since
Ruby's Time methods assume seconds anyway, it is reasonable to use seconds
here.

Doing so enables the implementation of a number of useful TimeRange methods.
Reimplementation of Range#max . TimeRange makes one assumption ; that ranges excluding end should be one second shorter than those that don ' t . Normal Ranges simply TypeError when excluding_end is true . However since Ruby ' s Time methods assume seconds anyway it is reasonable to use seconds here . Doing so enables the implementation of a number of useful TimeRange methods .
def max
    return self.end - 1 if exclude_end?
    super
  end
def max return self . end - 1 if exclude_end? super end
Reimplementation of Range#max.
Reimplementation of Range#max .
the highest time included in the range
the highest time included in the range
Time