Sha256: ce07971835386342eec4256894d04bc51de9c3061b1e9c11a99cc1b1f846cfc7

Contents?: true

Size: 341 Bytes

Versions: 14

Compression:

Stored size: 341 Bytes

Contents

# frozen_string_literal: true

module Montrose
  class Frequency
    class Monthly < Frequency
      def include?(time)
        matches_interval?((time.month - @starts.month) + (time.year - @starts.year) * 12)
      end

      def to_cron
        "#{@starts.min} #{@starts.hour} #{@starts.day} #{interval_str} *"
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
montrose-0.17.0 lib/montrose/frequency/monthly.rb
montrose-0.16.0 lib/montrose/frequency/monthly.rb
montrose-0.15.0 lib/montrose/frequency/monthly.rb
montrose-0.14.0 lib/montrose/frequency/monthly.rb
montrose-0.13.0 lib/montrose/frequency/monthly.rb
montrose-0.12.0 lib/montrose/frequency/monthly.rb
montrose-0.11.2 lib/montrose/frequency/monthly.rb
montrose-0.11.1 lib/montrose/frequency/monthly.rb
montrose-0.11.0 lib/montrose/frequency/monthly.rb
montrose-0.10.1 lib/montrose/frequency/monthly.rb
montrose-0.10.0 lib/montrose/frequency/monthly.rb
montrose-0.9.0 lib/montrose/frequency/monthly.rb
montrose-0.8.2 lib/montrose/frequency/monthly.rb
montrose-0.8.1 lib/montrose/frequency/monthly.rb