Sha256: 4d85b1b371e640bc5948059e7161b9f5e36874a8a5563dab8cb519e2a8eaadcd

Contents?: true

Size: 459 Bytes

Versions: 6

Compression:

Stored size: 459 Bytes

Contents

# frozen_string_literal: true

module Montrose
  module Rule
    class MinuteOfHour
      include Montrose::Rule

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

      # Initializes rule
      #
      # @param minutes [Array<Fixnum>] valid minutes of hour, e.g. [0, 20, 59]
      #
      def initialize(minutes)
        @minutes = minutes
      end

      def include?(time)
        @minutes.include?(time.min)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
montrose-0.18.0 lib/montrose/rule/minute_of_hour.rb
montrose-0.17.0 lib/montrose/rule/minute_of_hour.rb
montrose-0.16.0 lib/montrose/rule/minute_of_hour.rb
montrose-0.15.0 lib/montrose/rule/minute_of_hour.rb
montrose-0.14.0 lib/montrose/rule/minute_of_hour.rb
montrose-0.13.0 lib/montrose/rule/minute_of_hour.rb