Sha256: bb879b66a91c257c79186a7d10306d86c33169925ecb3a625a61ff3964f73c24

Contents?: true

Size: 307 Bytes

Versions: 7

Compression:

Stored size: 307 Bytes

Contents

module RRule
  class Monthly < Frequency
    def possible_days
      # yday is 1-indexed, need results 0-indexed
      (current_date.beginning_of_month.yday - 1..current_date.end_of_month.yday - 1).to_a
    end

    private

    def advance_by
      { months: context.options[:interval] }
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rrule-0.4.1 lib/rrule/frequencies/monthly.rb
rrule-0.4.0 lib/rrule/frequencies/monthly.rb
rrule-0.3.1 lib/rrule/frequencies/monthly.rb
rrule-0.3.0 lib/rrule/frequencies/monthly.rb
rrule-0.2.1 lib/rrule/frequencies/monthly.rb
rrule-0.1.1 lib/rrule/frequencies/monthly.rb
rrule-0.1.0 lib/rrule/frequencies/monthly.rb