module Timerage

Constants

VERSION

Public Class Methods

parse_iso8601(str, exclusive_end: true) click to toggle source

Returns a Time or Timerage::TimeInterval representation of the iso8601 str.

Currently this only supports `<begin>/<end>` style time intervals.

# File lib/timerage.rb, line 13
def self.parse_iso8601(str, exclusive_end: true)
  TimeInterval.iso8601(str, exclusive_end: exclusive_end)
rescue ArgumentError
  Time.iso8601(str)
end

Public Instance Methods

step(n, &blk) click to toggle source
Calls superclass method
# File lib/timerage.rb, line 20
def step(n, &blk)
  if self.begin.kind_of?(Time) || self.begin.kind_of?(Date)
    Timerage::TimeInterval.new(self).step(n, &blk)
  else
    super
  end
end
to_time_interval() click to toggle source
# File lib/timerage.rb, line 28
def to_time_interval
  Timerage::TimeInterval.new(self)
end