Class: TExp::DayOfMonth
Instance Method Summary collapse
-
#encode(codes) ⇒ Object
Encode the temporal expression into
codes
. -
#includes?(date) ⇒ Boolean
Is
date
included in the temporal expression. -
#initialize(days) ⇒ DayOfMonth
constructor
A new instance of DayOfMonth.
-
#inspect ⇒ Object
Human readable version of the temporal expression.
Methods inherited from Base
#*, #+, #-, #-@, #each, #first_day_of_window, #include?, #last_day_of_window, parse_callback, #reanchor, register_parse_callback, #to_s, #window
Constructor Details
#initialize(days) ⇒ DayOfMonth
Returns a new instance of DayOfMonth.
5 6 7 |
# File 'lib/texp/day_of_month.rb', line 5 def initialize(days) @days = listize(days) end |
Instance Method Details
#encode(codes) ⇒ Object
Encode the temporal expression into codes
.
21 22 23 24 |
# File 'lib/texp/day_of_month.rb', line 21 def encode(codes) encode_list(codes, @days) codes << encoding_token end |
#includes?(date) ⇒ Boolean
Is date
included in the temporal expression.
10 11 12 |
# File 'lib/texp/day_of_month.rb', line 10 def includes?(date) @days.include?(date.day) end |
#inspect ⇒ Object
Human readable version of the temporal expression.
15 16 17 18 |
# File 'lib/texp/day_of_month.rb', line 15 def inspect "the day of the month is the " + ordinal_list(@days) end |