A Span represents a range of time. Since this class extends Range, you can use begin and end to get the beginning and ending times of the span (they will be of class Time)
Add a number of seconds to this span, returning the resulting Span
# File lib/chronic/chronic.rb, line 217 def +(seconds) Span.new(self.begin + seconds, self.end + seconds) end
Subtract a number of seconds to this span, returning the resulting Span
# File lib/chronic/chronic.rb, line 223 def -(seconds) self + -seconds end
Prints this span in a nice fashion
# File lib/chronic/chronic.rb, line 228 def to_s '(' << self.begin.to_s << '..' << self.end.to_s << ')' end
Returns the width of this span in seconds
# File lib/chronic/chronic.rb, line 211 def width (self.end - self.begin).to_i end