class Runt::REMonth
TExpr that matches a range of dates within a month. For example:
REMonth.(12,28)
matches from the 12th thru the 28th of any month. If end_day==0 or is not given, start_day will define the range with that single day.
See also: Date
Attributes
range[R]
Public Class Methods
new(start_day, end_day=0)
click to toggle source
# File lib/runt/temporalexpression.rb, line 738 def initialize(start_day, end_day=0) end_day=start_day if end_day==0 @range = start_day..end_day end
Public Instance Methods
==(o)
click to toggle source
Calls superclass method
# File lib/runt/temporalexpression.rb, line 743 def ==(o) o.is_a?(REMonth) ? range == o.range : super(o) end
include?(date)
click to toggle source
# File lib/runt/temporalexpression.rb, line 747 def include?(date) @range.include? date.mday end
to_s()
click to toggle source
# File lib/runt/temporalexpression.rb, line 751 def to_s "from the #{Runt.ordinalize(@range.begin)} to the #{Runt.ordinalize(@range.end)} monthly" end