Class: Loco::Sender
- Inherits:
-
Object
- Object
- Loco::Sender
- Defined in:
- lib/loco/sender.rb
Instance Method Summary collapse
- #emit ⇒ Object
-
#initialize(recipient, data = {}) ⇒ Sender
constructor
A new instance of Sender.
Constructor Details
#initialize(recipient, data = {}) ⇒ Sender
Returns a new instance of Sender.
3 4 5 6 |
# File 'lib/loco/sender.rb', line 3 def initialize recipient, data = {} @recipients = [*recipient] @data = data end |
Instance Method Details
#emit ⇒ Object
8 9 10 11 12 |
# File 'lib/loco/sender.rb', line 8 def emit uuids.each do |uuid| NotificationCenterChannel.broadcast_to uuid, @data end end |