Parent

Included Modules

Runt::DayIntervalTE

Using day precision dates, matches every n number of days after a given base date. All date arguments are converted to DPrecision::DAY precision.

Contributed by Ira Burton

Public Class Methods

new(base_date,n) click to toggle source
# File lib/runt/temporalexpression.rb, line 713
def initialize(base_date,n)
  @base_date = DPrecision.to_p(base_date,DPrecision::DAY)
  @interval = n
end

Public Instance Methods

include?(date) click to toggle source
# File lib/runt/temporalexpression.rb, line 718
def include?(date)
  return ((DPrecision.to_p(date,DPrecision::DAY) - @base_date).to_i % @interval == 0)   
end
to_s() click to toggle source
# File lib/runt/temporalexpression.rb, line 722
def to_s
  "every #{Runt.ordinalize(@interval)} day after #{Runt.format_date(@base_date)}"
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.