Class: Montrose::Rule::NthDayOfMonth
- Inherits:
-
Object
- Object
- Montrose::Rule::NthDayOfMonth
- Includes:
- Montrose::Rule
- Defined in:
- lib/montrose/rule/nth_day_of_month.rb
Defined Under Namespace
Classes: MonthDay
Class Method Summary collapse
Instance Method Summary collapse
- #include?(time) ⇒ Boolean
-
#initialize(days) ⇒ NthDayOfMonth
constructor
Initializes rule.
Methods included from Montrose::Rule
#advance!, #continue?, included
Constructor Details
#initialize(days) ⇒ NthDayOfMonth
Initializes rule
20 21 22 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 20 def initialize(days) @days = days end |
Class Method Details
.apply_options(opts) ⇒ Object
12 13 14 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 12 def self.(opts) opts[:day] end |
.apply_options?(opts) ⇒ Boolean
8 9 10 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 8 def self.(opts) (opts[:every] == :month || opts[:month]) && opts[:day].is_a?(Hash) end |
Instance Method Details
#include?(time) ⇒ Boolean
24 25 26 |
# File 'lib/montrose/rule/nth_day_of_month.rb', line 24 def include?(time) @days.key?(time.wday) && nth_day?(time) end |