Class: Montrose::Rule::During::TimeOfDayRange
- Inherits:
-
Object
- Object
- Montrose::Rule::During::TimeOfDayRange
- Defined in:
- lib/montrose/rule/during.rb
Instance Method Summary collapse
- #include?(time) ⇒ Boolean
-
#initialize(first, last, exclude_end: false) ⇒ TimeOfDayRange
constructor
A new instance of TimeOfDayRange.
Constructor Details
#initialize(first, last, exclude_end: false) ⇒ TimeOfDayRange
Returns a new instance of TimeOfDayRange.
25 26 27 28 29 |
# File 'lib/montrose/rule/during.rb', line 25 def initialize(first, last, exclude_end: false) @first = ::Montrose::TimeOfDay.new(first) @last = ::Montrose::TimeOfDay.new(last) @exclude_end = exclude_end end |
Instance Method Details
#include?(time) ⇒ Boolean
31 32 33 |
# File 'lib/montrose/rule/during.rb', line 31 def include?(time) range.include?(time.seconds_since_midnight.to_i) end |