class Montrose::Rule::HourOfDay

Public Class Methods

apply_options(opts) click to toggle source
# File lib/montrose/rule/hour_of_day.rb, line 8
def self.apply_options(opts)
  opts[:hour]
end
new(hours) click to toggle source

Initializes rule

@param hours [Array<Fixnum>] valid hours of days, e.g. [1, 2, 24]

# File lib/montrose/rule/hour_of_day.rb, line 16
def initialize(hours)
  @hours = hours
end

Public Instance Methods

include?(time) click to toggle source
# File lib/montrose/rule/hour_of_day.rb, line 20
def include?(time)
  @hours.include?(time.hour)
end