Class: RRule::ByYearDay

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

Instance Method Summary collapse

Constructor Details

#initialize(by_year_days, context) ⇒ ByYearDay

Returns a new instance of ByYearDay.



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

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

Instance Method Details

#reject?(i) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
13
14
# File 'lib/rrule/filters/by_year_day.rb', line 10

def reject?(i)
  !by_year_days.empty? &&
    ((i < context.year_length_in_days && !by_year_days.include?(i + 1) && !by_year_days.include?(i - context.year_length_in_days)) ||
      (i >= context.year_length_in_days && !by_year_days.include?(i + 1 - context.year_length_in_days) && !by_year_days.include?(i - context.year_length_in_days - context.next_year_length_in_days)))
end