class Montrose::Rule::WeekOfYear
Public Class Methods
apply_options(opts)
click to toggle source
# File lib/montrose/rule/week_of_year.rb, line 8 def self.apply_options(opts) opts[:week] end
new(weeks)
click to toggle source
Initializes rule
@param [Array] weeks - valid weeks of year
# File lib/montrose/rule/week_of_year.rb, line 16 def initialize(weeks) @weeks = weeks end
Public Instance Methods
include?(time)
click to toggle source
# File lib/montrose/rule/week_of_year.rb, line 20 def include?(time) @weeks.include?(time.to_date.cweek) end