Class: Report::CallStatistics::CallStatResultSummary
Instance Method Summary
collapse
#ext_conn_talk_time_humanized, #format_time_for_humans, #inbound_direct_talk_time_humanized, #inbound_from_queue_talk_time_humanized, #outbound_talk_time_humanized, #ttl_outbound_talk_time_humanized
Instance Method Details
#add_direct_inbound_talk_time(seconds) ⇒ Object
34
35
36
37
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 34
def add_direct_inbound_talk_time(seconds)
return unless seconds && seconds > 0
self.inbound_direct_talk_times << seconds
end
|
#add_ext_conn_talk_time(seconds) ⇒ Object
29
30
31
32
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 29
def add_ext_conn_talk_time(seconds)
return unless seconds && seconds > 0
self.ext_conn_talk_times << seconds
end
|
#add_outbound_talk_time(seconds) ⇒ Object
24
25
26
27
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 24
def add_outbound_talk_time(seconds)
return unless seconds && seconds > 0
self.outbound_talk_times << seconds
end
|
#add_queue_inbound_talk_time(seconds) ⇒ Object
39
40
41
42
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 39
def add_queue_inbound_talk_time(seconds)
return unless seconds && seconds > 0
self.inbound_from_queue_talk_times << seconds
end
|
#average_inbound_direct_talk_time_humanized ⇒ Object
67
68
69
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 67
def average_inbound_direct_talk_time_humanized
format_time_for_humans average_inbound_direct_talk_time_in_seconds
end
|
#average_inbound_direct_talk_time_in_seconds ⇒ Object
51
52
53
54
55
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 51
def average_inbound_direct_talk_time_in_seconds
inbound_direct_talk_times.delete(0) if inbound_direct_talk_times.present?
idtt = inbound_direct_talk_times.present? ? inbound_direct_talk_times.average : 0
idtt.floor
end
|
#average_inbound_from_queue_talk_time_in_seconds ⇒ Object
57
58
59
60
61
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 57
def average_inbound_from_queue_talk_time_in_seconds
inbound_from_queue_talk_times.delete(0) if inbound_from_queue_talk_times.present?
ifqtt = inbound_from_queue_talk_times.present? ? inbound_from_queue_talk_times.average : 0
ifqtt.floor
end
|
#average_inbound_from_queue_talk_times_humanized ⇒ Object
71
72
73
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 71
def average_inbound_from_queue_talk_times_humanized
format_time_for_humans average_inbound_from_queue_talk_time_in_seconds
end
|
#average_outbound_talk_time_humanized ⇒ Object
63
64
65
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 63
def average_outbound_talk_time_humanized
format_time_for_humans average_outbound_talk_time_in_seconds
end
|
#average_outbound_talk_time_in_seconds ⇒ Object
44
45
46
47
48
49
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 44
def average_outbound_talk_time_in_seconds
outbound_talk_times.delete(0) if outbound_talk_times.present?
ext_conn_talk_times.delete(0) if ext_conn_talk_times.present?
ott = outbound_talk_times.count.zero? ? 0 : ((outbound_talk_times.sum - ext_conn_talk_times.sum) / outbound_talk_times.count)
ott.floor
end
|
#ext_conn_talk_time_in_seconds ⇒ Object
12
13
14
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 12
def ext_conn_talk_time_in_seconds
ext_conn_talk_times.sum
end
|
#inbound_direct_talk_time_in_seconds ⇒ Object
16
17
18
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 16
def inbound_direct_talk_time_in_seconds
inbound_direct_talk_times.sum
end
|
#inbound_from_queue_talk_time_in_seconds ⇒ Object
20
21
22
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 20
def inbound_from_queue_talk_time_in_seconds
inbound_from_queue_talk_times.sum
end
|
#outbound_talk_time_in_seconds ⇒ Object
8
9
10
|
# File 'app/services/report/call_statistics/call_stat_result_summary.rb', line 8
def outbound_talk_time_in_seconds
outbound_talk_times.sum
end
|