class Montrose::Rule::DayOfWeek

Public Class Methods

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

Initializes rule

@param [Array<Fixnum>] days - valid days of week, e.g. [1, 2, 7]

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

Public Instance Methods

include?(time) click to toggle source
# File lib/montrose/rule/day_of_week.rb, line 20
def include?(time)
  @days.include?(time.wday)
end