Class: Report::CallStatistics::CallStatResult

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::API, ActiveModel::Attributes, ActiveModel::Validations::Callbacks, StripAttributes
Defined in:
app/services/report/call_statistics/call_stat_result.rb

Direct Known Subclasses

CallStatResultSummary

Instance Method Summary collapse

Instance Method Details

#ext_conn_talk_time_humanizedObject



35
36
37
# File 'app/services/report/call_statistics/call_stat_result.rb', line 35

def ext_conn_talk_time_humanized
  format_time_for_humans ext_conn_talk_time_in_seconds
end

#format_time_for_humans(time_in_seconds) ⇒ Object (protected)



53
54
55
56
57
58
# File 'app/services/report/call_statistics/call_stat_result.rb', line 53

def format_time_for_humans(time_in_seconds)
  return unless time_in_seconds && time_in_seconds > 0
  #Time.at(time_in_seconds).utc.strftime("%H:%M:%S")
  require 'chronic_duration'
  ChronicDuration.output(time_in_seconds, format: :short, limit_to_hours: true, units: 2)
end

#inbound_direct_talk_time_humanizedObject



47
48
49
# File 'app/services/report/call_statistics/call_stat_result.rb', line 47

def inbound_direct_talk_time_humanized
  format_time_for_humans inbound_direct_talk_time_in_seconds
end

#inbound_from_queue_talk_time_humanizedObject



43
44
45
# File 'app/services/report/call_statistics/call_stat_result.rb', line 43

def inbound_from_queue_talk_time_humanized
  format_time_for_humans inbound_from_queue_talk_time_in_seconds
end

#outbound_talk_time_humanizedObject



31
32
33
# File 'app/services/report/call_statistics/call_stat_result.rb', line 31

def outbound_talk_time_humanized
  format_time_for_humans outbound_talk_time_in_seconds
end

#ttl_outbound_talk_time_humanizedObject



39
40
41
# File 'app/services/report/call_statistics/call_stat_result.rb', line 39

def ttl_outbound_talk_time_humanized
  format_time_for_humans (outbound_talk_time_in_seconds - ext_conn_talk_time_in_seconds)
end