Class: Biz::Calculation::Active
- Inherits:
-
Object
- Object
- Biz::Calculation::Active
- Defined in:
- lib/biz/calculation/active.rb
Instance Method Summary collapse
-
#initialize(schedule, time) ⇒ Active
constructor
A new instance of Active.
- #result ⇒ Object
Constructor Details
#initialize(schedule, time) ⇒ Active
Returns a new instance of Active.
5 6 7 8 |
# File 'lib/biz/calculation/active.rb', line 5 def initialize(schedule, time) @schedule = schedule @time = time end |
Instance Method Details
#result ⇒ Object
10 11 12 13 |
# File 'lib/biz/calculation/active.rb', line 10 def result schedule.intervals.any? { |interval| interval.contains?(time) } && schedule.holidays.none? { |holiday| holiday.contains?(time) } end |