Sha256: 4ac6e91e689606c28b88787c9b693e47cb02d6871f00b35192d06783901dd539

Contents?: true

Size: 406 Bytes

Versions: 12

Compression:

Stored size: 406 Bytes

Contents

module Montrose
  module Rule
    class WeekOfYear
      include Montrose::Rule

      def self.apply_options(opts)
        opts[:week]
      end

      # Initializes rule
      #
      # @param [Array[Fixnum]] weeks - valid weeks of year
      #
      def initialize(weeks)
        @weeks = weeks
      end

      def include?(time)
        @weeks.include?(time.to_date.cweek)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
montrose-0.6.0 lib/montrose/rule/week_of_year.rb
montrose-0.5.0 lib/montrose/rule/week_of_year.rb
montrose-0.4.3 lib/montrose/rule/week_of_year.rb
montrose-0.4.2 lib/montrose/rule/week_of_year.rb
montrose-0.4.1 lib/montrose/rule/week_of_year.rb
montrose-0.4.0 lib/montrose/rule/week_of_year.rb
montrose-0.3.0 lib/montrose/rule/week_of_year.rb
montrose-0.2.2 lib/montrose/rule/week_of_year.rb
montrose-0.2.1 lib/montrose/rule/week_of_year.rb
montrose-0.2.0 lib/montrose/rule/week_of_year.rb
montrose-0.1.1 lib/montrose/rule/week_of_year.rb
montrose-0.1.0 lib/montrose/rule/week_of_year.rb