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.
7 8 9 10 |
# File 'lib/biz/calculation/active.rb', line 7 def initialize(schedule, time) @schedule = schedule @time = time end |
Instance Method Details
#result ⇒ Object
12 13 14 15 16 |
# File 'lib/biz/calculation/active.rb', line 12 def result return in_hours? && active? if schedule.shifts.none? schedule.periods.after(time).first.contains?(time) end |