Class: Montrose::Rule::MonthOfYear

Inherits:
Object
  • Object
show all
Includes:
Montrose::Rule
Defined in:
lib/montrose/rule/month_of_year.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Montrose::Rule

#advance!, #continue?, included

Constructor Details

#initialize(months) ⇒ MonthOfYear

Initializes rule

Parameters:

  • months (Array)
    • valid month numbers


15
16
17
# File 'lib/montrose/rule/month_of_year.rb', line 15

def initialize(months)
  @months = months
end

Class Method Details

.apply_options(opts) ⇒ Object


7
8
9
# File 'lib/montrose/rule/month_of_year.rb', line 7

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

Instance Method Details

#include?(time) ⇒ Boolean

Returns:

  • (Boolean)

19
20
21
# File 'lib/montrose/rule/month_of_year.rb', line 19

def include?(time)
  @months.include?(time.month)
end