lib/time_range.rb
# Compares another time range for complete encapsulation. A time range is
# considered encapsulated if it begins and ends within this one, including if
# the ranges match exactly.
#
# @param [TimeRange] time_range time range to compare for encapsulation
# @return [Boolean] whether the target range is encapsulated
Compares another time range for complete encapsulation. A time range is
considered encapsulated if it begins and ends within this one, including if
the ranges match exactly.
Compares another time range for complete encapsulation . A time range is considered encapsulated if it begins and ends within this one including if the ranges match exactly .
def encapsulates?(time_range)
    raise TypeError unless time_range.is_a?(TimeRange)
    self.begin <= time_range.begin && max >= time_range.max
  end
def encapsulates? ( time_range ) raise TypeError unless time_range . is_a? ( TimeRange ) self . begin <= time_range . begin && max >= time_range . max end
Compares another time range for complete encapsulation.
Compares another time range for complete encapsulation .
whether the target range is encapsulated
whether the target range is encapsulated
Boolean
time_range
time_range time range to compare for encapsulation
time_range time range to compare for encapsulation