Class: IronAdmin::Live::Broadcaster
- Inherits:
-
Object
- Object
- IronAdmin::Live::Broadcaster
- Defined in:
- lib/iron_admin/live/broadcaster.rb
Instance Method Summary collapse
- #broadcast_prepend(stream, target:, html:) ⇒ Object
- #broadcast_remove(stream, target:) ⇒ Object
- #broadcast_replace(stream, target:, html:) ⇒ Object
-
#initialize(cache: IronAdmin::Live.poll_cache) ⇒ Broadcaster
constructor
A new instance of Broadcaster.
Constructor Details
#initialize(cache: IronAdmin::Live.poll_cache) ⇒ Broadcaster
Returns a new instance of Broadcaster.
8 9 10 |
# File 'lib/iron_admin/live/broadcaster.rb', line 8 def initialize(cache: IronAdmin::Live.poll_cache) @cache = cache end |
Instance Method Details
#broadcast_prepend(stream, target:, html:) ⇒ Object
16 17 18 |
# File 'lib/iron_admin/live/broadcaster.rb', line 16 def broadcast_prepend(stream, target:, html:) broadcast_action(stream, action: :prepend, target: target, html: html) end |
#broadcast_remove(stream, target:) ⇒ Object
20 21 22 |
# File 'lib/iron_admin/live/broadcaster.rb', line 20 def broadcast_remove(stream, target:) broadcast_action(stream, action: :remove, target: target) end |
#broadcast_replace(stream, target:, html:) ⇒ Object
12 13 14 |
# File 'lib/iron_admin/live/broadcaster.rb', line 12 def broadcast_replace(stream, target:, html:) broadcast_action(stream, action: :replace, target: target, html: html) end |