turniere-backend/app/services/tournament_timer_broadcast.rb

16 lines
344 B
Ruby

# frozen_string_literal: true
class TournamentTimerBroadcast
class << self
def call(tournament_id)
tournament = Tournament.find_by(id: tournament_id)
return if tournament.nil?
TournamentTimersChannel.broadcast_to(
tournament,
TournamentTimerBroadcastPayload.build(tournament)
)
end
end
end