Class: Montrose::Rule::TimeOfDay

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

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Montrose::Rule

#advance!, #continue?, included

Constructor Details

#initialize(times) ⇒ TimeOfDay

Initializes rule

Parameters:

  • times (Array<Time>)
    • valid times



16
17
18
# File 'lib/montrose/rule/time_of_day.rb', line 16

def initialize(times)
  @times = times
end

Class Method Details

.apply_options(opts) ⇒ Object



8
9
10
# File 'lib/montrose/rule/time_of_day.rb', line 8

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

Instance Method Details

#include?(time) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/montrose/rule/time_of_day.rb', line 20

def include?(time)
  @times.include?(parts(time))
end