Class: RiCal::PropertyValue::RecurrenceRule::RecurringNumberedWeek
- Inherits:
-
NumberedSpan
show all
- Defined in:
- lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb
Overview
Instance Attribute Summary
Attributes inherited from NumberedSpan
#source
Instance Method Summary
collapse
#==, #initialize, #ordinal, #to_s, #valid?
Instance Method Details
#adjusted_iso_weeknum(date_or_time) ⇒ Object
17
18
19
20
21
22
23
|
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 17
def adjusted_iso_weeknum(date_or_time)
if @source > 0
@source
else
date_or_time.iso_weeks_in_year(wkst) + @source + 1
end
end
|
#default_wkst ⇒ Object
13
14
15
|
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 13
def default_wkst
rule_wkst || 1
end
|
#include?(date_or_time, wkst = default_wkst) ⇒ Boolean
25
26
27
|
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 25
def include?(date_or_time, wkst=default_wkst)
date_or_time.iso_week_num(wkst) == adjusted_iso_weeknum(date_or_time)
end
|
5
6
7
|
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 5
def last
53
end
|
#rule_wkst ⇒ Object
9
10
11
|
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 9
def rule_wkst
@rule && rule.wkst_day
end
|