Class | Runt::REYear |
In: |
lib/runt/temporalexpression.rb
|
Parent: | Object |
TExpr that matches date ranges within a single year. Assumes that the start and end parameters occur within the same year.
NO_DAY | = | 0 | Sentinel value used to denote that no specific day was given to create the expression. |
end_day | [RW] | |
end_month | [RW] | |
start_day | [RW] | |
start_month | [RW] |
REYear.new(start_month [, (start_day | end_month), ...]
One or two arguments given::
start_month: | Start month. Valid values are 1..12. When no other parameters are given this value will be used for the end month as well. Matches the entire month through the ending month. |
end_month: | End month. Valid values are 1..12. When given in two argument form will match through the entire month. |
Three or four arguments given::
start_month: | Start month. Valid values are 1..12. |
start_day: | Start day. Valid values are 1..31, depending on the month. |
end_month: | End month. Valid values are 1..12. If a fourth argument is not given, this value will cover through the entire month. |
end_day: | End day. Valid values are 1..31, depending on the month. |
Create a new REYear expression expressing a range of months or days within months within a year.
# Creates the range March 12th through May 23rd expr = REYear.new(3,12,5,23) # Creates the range March 1st through May 31st expr = REYear.new(3,5) # Creates the range March 12th through May 31st expr = REYear.new(3,12,5) # Creates the range March 1st through March 30th expr = REYear.new(3)