Xiaohong-Deng/mooqita-icccg

View on GitHub
app/jobs/participants_broadcast_job.rb

Summary

Maintainability
A
0 mins
Test Coverage
class ParticipantsBroadcastJob < ApplicationJob
  include Templatable

  queue_as :default

  def perform(game)
    ActionCable.server.broadcast('waiting-room', data_for(game))
  end

  private

  def data_for(game)
    game ? game_starting(game) : participants_size
  end
end