Sha256: c825b5edb60113aa153512a21c8b6df17ac9f47c0ee53eccee83e061794fce29

Contents?: true

Size: 363 Bytes

Versions: 12

Compression:

Stored size: 363 Bytes

Contents

# frozen_string_literal: true

module Montrose
  class Frequency
    class Yearly < Frequency
      def include?(time)
        matches_interval? time.year - @starts.year
      end

      def to_cron
        raise "Intervals unsupported" unless @interval == 1

        "#{@starts.min} #{@starts.hour} #{@starts.day} #{@starts.month} *"
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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