Class: Report::CallStatistics::CallStatResult
- Inherits:
-
Object
- Object
- Report::CallStatistics::CallStatResult
- Includes:
- ActiveModel::API, ActiveModel::Attributes, ActiveModel::Validations::Callbacks, StripAttributes
- Defined in:
- app/services/report/call_statistics/call_stat_result.rb
Overview
Service object: call stat result.
Direct Known Subclasses
Instance Method Summary collapse
-
#ext_conn_talk_time_humanized ⇒ Object
Ext conn talk time humanized.
-
#format_time_for_humans(time_in_seconds) ⇒ Object
protected
Format time for humans.
-
#inbound_direct_talk_time_humanized ⇒ Object
Inbound direct talk time humanized.
-
#inbound_from_queue_talk_time_humanized ⇒ Object
Inbound from queue talk time humanized.
-
#outbound_talk_time_humanized ⇒ Object
Outbound talk time humanized.
-
#ttl_outbound_talk_time_humanized ⇒ Object
Ttl outbound talk time humanized.
Instance Method Details
#ext_conn_talk_time_humanized ⇒ Object
Ext conn talk time humanized.
42 43 44 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 42 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)
Format time for humans.
69 70 71 72 73 74 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 69 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") Heatwave::Duration.humanize(time_in_seconds, format: :short, limit_to_hours: true, units: 2) end |
#inbound_direct_talk_time_humanized ⇒ Object
Inbound direct talk time humanized.
60 61 62 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 60 def inbound_direct_talk_time_humanized format_time_for_humans inbound_direct_talk_time_in_seconds end |
#inbound_from_queue_talk_time_humanized ⇒ Object
Inbound from queue talk time humanized.
54 55 56 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 54 def inbound_from_queue_talk_time_humanized format_time_for_humans inbound_from_queue_talk_time_in_seconds end |
#outbound_talk_time_humanized ⇒ Object
Outbound talk time humanized.
36 37 38 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 36 def outbound_talk_time_humanized format_time_for_humans outbound_talk_time_in_seconds end |
#ttl_outbound_talk_time_humanized ⇒ Object
Ttl outbound talk time humanized.
48 49 50 |
# File 'app/services/report/call_statistics/call_stat_result.rb', line 48 def ttl_outbound_talk_time_humanized format_time_for_humans(outbound_talk_time_in_seconds - ext_conn_talk_time_in_seconds) end |