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

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

Overview

  • ©2009 Rick DeNatale, All rights reserved. Refer to the file README.txt for the license

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



19
20
21
22
23
24
25
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 19

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



15
16
17
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 15

def default_wkst
  rule_wkst || 1
end

#include?(date_or_time, wkst = default_wkst) ⇒ Boolean

Returns:

  • (Boolean)


27
28
29
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 27

def include?(date_or_time, wkst=default_wkst)
  date_or_time.iso_week_num(wkst) == adjusted_iso_weeknum(date_or_time)
end

#lastObject

:nodoc:



7
8
9
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 7

def last
  53
end

#rule_wkstObject



11
12
13
# File 'lib/ri_cal/property_value/recurrence_rule/recurring_numbered_week.rb', line 11

def rule_wkst
  @rule && rule.wkst_day
end