Class: Biz::Calculation::OnBreak

Inherits:
Object
  • Object
show all
Defined in:
lib/biz/calculation/on_break.rb

Instance Method Summary collapse

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

#resultObject



12
13
14
# File 'lib/biz/calculation/on_break.rb', line 12

def result
  schedule.breaks.any? { |brake| brake.contains?(time) }
end