Class: RRule::ByWeekNumber

Inherits:
Object
  • Object
show all
Defined in:
lib/rrule/filters/by_week_number.rb

Instance Method Summary collapse

Constructor Details

#initialize(by_week_numbers, context) ⇒ ByWeekNumber

Returns a new instance of ByWeekNumber.



5
6
7
8
# File 'lib/rrule/filters/by_week_number.rb', line 5

def initialize(by_week_numbers, context)
  @by_week_numbers = by_week_numbers
  @context = context
end

Instance Method Details

#reject?(i) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/rrule/filters/by_week_number.rb', line 10

def reject?(i)
  !by_week_numbers.include?(context.week_number_by_day_of_year[i]) && !by_week_numbers.include?(context.negative_week_number_by_day_of_year[i])
end