Class: EmployeePhoneStatus::QueueStatusPuller
- Inherits:
-
Object
- Object
- EmployeePhoneStatus::QueueStatusPuller
- Includes:
- Service
- Defined in:
- app/services/employee_phone_status/queue_status_puller.rb
Overview
Merges periodic Switchvox queue snapshots into the webhook-backed state for
each employee without losing newer callbacks or queues omitted by a partial
PBX response.
Instance Method Summary collapse
-
#call ⇒ Array
Retained for the legacy +pull_queue_status+ contract.
Methods included from Service
#attributes_used, #build_result, call, #logger
Methods included from Service::Initializer
Instance Method Details
#call ⇒ Array
Returns retained for the legacy +pull_queue_status+ contract.
13 14 15 16 17 18 19 20 21 22 |
# File 'app/services/employee_phone_status/queue_status_puller.rb', line 13 def call self.observed_at ||= Time.current statuses_by_account.each do |switchvox_account_id, queue_statuses| phone_status = EmployeePhoneStatus.find_by(switchvox_account_id:) merge_snapshot(phone_status, queue_statuses) if phone_status end [] end |