@@ -37,14 +37,20 @@ def run
3737
3838 def output_csv_lines_for ( date )
3939 if holiday_dates . include? ( date )
40- generate_output ( date , rand ( 12_000 ..13_500 ) , distribution . special_day , distribution . special_week )
40+ generate_output (
41+ date , rand ( 12_000 ..13_500 ) ,
42+ distribution . special_day , distribution . special_week
43+ )
4144 else
42- generate_output ( date , rand ( 13_500 ..14_500 ) , distribution . normal_day , distribution . normal_week )
43- end
45+ generate_output ( date , rand ( 13_500 ..14_500 ) ,
46+ distribution . normal_day , distribution . normal_week )
47+ end
4448 end
4549
4650 def holiday_dates
47- dates ||= HolidayClient . new ( start_date , end_date , region ) . holidays . map { |h | h [ 1 ] }
51+ HolidayClient . new (
52+ start_date , end_date , region
53+ ) . holidays . map { |h | h [ 1 ] }
4854 end
4955
5056 private
@@ -61,16 +67,19 @@ def header
6167 'Queue;Date;Time;CallsOffered;CallsHandled;AHT'
6268 end
6369
64- def generate_output ( date , weekly_volume , daily_distribution , weekly_destribution )
70+ def generate_output ( date , weekly_volume ,
71+ daily_distribution , weekly_destribution )
6572 daily_volume = weekly_destribution [ date . wday ] * weekly_volume
6673 daily_distribution . each_with_index do |value , interval |
67- random_value = IntervalValueRandomizer . new ( daily_volume , value )
74+ random = IntervalValueRandomizer . new ( daily_volume , value )
6875 time_string = build_time_string ( interval )
69- puts "#{ queue_name } ;#{ date . strftime ( '%d.%m.%Y' ) } ;#{ time_string } ;#{ random_value . calls } ;#{ random_value . handled_calls } ;#{ random_value . aht } "
76+ puts "#{ queue_name } ;#{ date . strftime ( '%d.%m.%Y' ) } ;#{ time_string } ;" \
77+ "#{ random . calls } ;#{ random . handled_calls } ;#{ random . aht } "
7078 end
7179 end
7280
7381 def distribution
74- Distribution . new ( open_time : @opening_hours . open , close_time : @opening_hours . close )
82+ Distribution . new ( open_time : @opening_hours . open ,
83+ close_time : @opening_hours . close )
7584 end
7685end
0 commit comments