Class: Montrose::Rule::MonthOfYear
- Inherits:
-
Object
- Object
- Montrose::Rule::MonthOfYear
- Includes:
- Montrose::Rule
- Defined in:
- lib/montrose/rule/month_of_year.rb
Class Method Summary collapse
Instance Method Summary collapse
- #include?(time) ⇒ Boolean
-
#initialize(months) ⇒ MonthOfYear
constructor
Initializes rule.
Methods included from Montrose::Rule
#advance!, #continue?, included
Constructor Details
#initialize(months) ⇒ MonthOfYear
Initializes rule
16 17 18 |
# File 'lib/montrose/rule/month_of_year.rb', line 16 def initialize(months) @months = months end |
Class Method Details
.apply_options(opts) ⇒ Object
8 9 10 |
# File 'lib/montrose/rule/month_of_year.rb', line 8 def self.(opts) opts[:month] end |
Instance Method Details
#include?(time) ⇒ Boolean
20 21 22 |
# File 'lib/montrose/rule/month_of_year.rb', line 20 def include?(time) @months.include?(time.month) end |