Sha256: de7e551a43c0e5cc5ca8dd1c3b168ad359d73954d9085916f7b17f0e107d3c7a

Contents?: true

Size: 405 Bytes

Versions: 12

Compression:

Stored size: 405 Bytes

Contents

module Montrose
  module Rule
    class DayOfWeek
      include Montrose::Rule

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

      # Initializes rule
      #
      # @param [Array<Fixnum>] days - valid days of week, e.g. [1, 2, 7]
      #
      def initialize(days)
        @days = days
      end

      def include?(time)
        @days.include?(time.wday)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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