Class: Biz::Calculation::OnBreak
- Inherits:
-
Object
- Object
- Biz::Calculation::OnBreak
- Defined in:
- lib/biz/calculation/on_break.rb
Instance Method Summary collapse
-
#initialize(schedule, time) ⇒ OnBreak
constructor
A new instance of OnBreak.
- #result ⇒ Object
Constructor Details
#initialize(schedule, time) ⇒ OnBreak
Returns a new instance of OnBreak.
7 8 9 10 |
# File 'lib/biz/calculation/on_break.rb', line 7 def initialize(schedule, time) @schedule = schedule @time = time end |
Instance Method Details
#result ⇒ Object
12 13 14 |
# File 'lib/biz/calculation/on_break.rb', line 12 def result schedule.breaks.any? { |brake| brake.contains?(time) } end |