Class: RiCal::PropertyValue::RecurrenceRule::RecurringNumberedWeek

Inherits:
NumberedSpan show all
Defined in:
lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb

Overview

:nodoc:

Instance Attribute Summary

Attributes inherited from NumberedSpan

#source

Instance Method Summary collapse

Methods inherited from NumberedSpan

#==, #initialize, #ordinal, #to_s, #valid?

Constructor Details

This class inherits a constructor from RiCal::PropertyValue::RecurrenceRule::NumberedSpan

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_wkstObject



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

Returns:

  • (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

#lastObject



5
6
7
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 5

def last
  53
end

#rule_wkstObject



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