class Runt::WIMonth
TExpr that matches the week in a month. For example:
WIMonth.new(1) See also: Date FIXME .dates mixin seems functionally broken
Constants
- VALID_RANGE
Attributes
ordinal[R]
Public Class Methods
new(ordinal)
click to toggle source
# File lib/runt/temporalexpression.rb, line 703 def initialize(ordinal) unless VALID_RANGE.include?(ordinal) raise ArgumentError, 'invalid ordinal week of month' end @ordinal = ordinal end
Public Instance Methods
==(o)
click to toggle source
Calls superclass method
# File lib/runt/temporalexpression.rb, line 710 def ==(o) o.is_a?(WIMonth) ? ordinal == o.ordinal : super(o) end
include?(date)
click to toggle source
# File lib/runt/temporalexpression.rb, line 714 def include?(date) week_matches?(@ordinal,date) end
to_s()
click to toggle source
# File lib/runt/temporalexpression.rb, line 718 def to_s "#{Runt.ordinalize(@ordinal)} week of any month" end