lib/timerage/time_interval.rb in timerage-1.1.2 vs lib/timerage/time_interval.rb in timerage-1.2.0
- old
+ new
@@ -21,9 +21,15 @@
else
time_enumerator(n)
end
end
+ # Returns and ISO8601 interval representation of self
+ # Takes same args as Time#iso8601
+ def iso8601(*args)
+ "#{self.begin.iso8601(*args)}/#{self.end.iso8601(*args)}"
+ end
+
protected
def rangeish?(an_obj)
an_obj.respond_to?(:begin) &&
an_obj.respond_to?(:end)