Class: RRule::ByMonthDay

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

Instance Method Summary collapse

Constructor Details

#initialize(by_month_days, context) ⇒ ByMonthDay

Returns a new instance of ByMonthDay.



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

def initialize(by_month_days, context)
  @context = context
  @positive_month_days, @negative_month_days = by_month_days.partition { |mday| mday > 0 }
end

Instance Method Details

#reject?(i) ⇒ Boolean

Returns:

  • (Boolean)


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

def reject?(i)
  !positive_month_days.include?(context.month_day_by_day_of_year[i]) && !negative_month_days.include?(context.negative_month_day_by_day_of_year[i])
end