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