Class: Loco::Sender

Inherits:
Object
  • Object
show all
Defined in:
lib/loco/sender.rb

Instance Method Summary collapse

Constructor Details

#initialize(recipient, data = {}) ⇒ Sender

Returns a new instance of Sender.



5
6
7
8
# File 'lib/loco/sender.rb', line 5

def initialize(recipient, data = {})
  @recipients = [*recipient]
  @data = data
end

Instance Method Details

#emitObject



10
11
12
13
14
15
# File 'lib/loco/sender.rb', line 10

def emit
  uuids.each do |uuid|
    NotificationCenterChannel.broadcast_to(uuid, payload)
  end
  @data[:loco][:idempotency_key]
end