lib/time_range.rb
# Returns the overlap between this and the argument as a new time range.
#
# @param [TimeRange] time_range time range to compare for encapsulation
# @return [TimeRange, nil] the overlap in a TimeRange or nil if none occurs
Returns the overlap between this and the argument as a new time range.
Returns the overlap between this and the argument as a new time range .
def overlap_with(time_range)
    raise TypeError unless time_range.is_a?(TimeRange)
    self.class.new(
      [self.begin, time_range.begin].max,
      [max, time_range.max].min
    ) if overlaps?(time_range)
  end
def overlap_with ( time_range ) raise TypeError unless time_range . is_a? ( TimeRange ) self . class . new ( [ self . begin , time_range . begin ] . max , [ max , time_range . max ] . min ) if overlaps? ( time_range ) end
Returns the overlap between this and the argument as a new time range.
Returns the overlap between this and the argument as a new time range .
the overlap in a TimeRange or nil if none occurs
the overlap in a TimeRange or nil if none occurs
TimeRange, nil
time_range
time_range time range to compare for encapsulation
time_range time range to compare for encapsulation