Sha256: 979edb540af203215c8ad96dba848d7937d02868fa92a26a93b2b05ca6177290

Contents?: true

Size: 411 Bytes

Versions: 10

Compression:

Stored size: 411 Bytes

Contents

module Montrose
  module Rule
    class HourOfDay
      include Montrose::Rule

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

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

      def include?(time)
        @hours.include?(time.hour)
      end
    end
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

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