Class: UNotifier::Provider::System::ActionCable
- Inherits:
-
ProviderBase
- Object
- ProviderBase
- UNotifier::Provider::System::ActionCable
- Defined in:
- lib/provider/system/action_cable.rb
Instance Attribute Summary collapse
-
#channel_name ⇒ Object
Returns the value of attribute channel_name.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
-
#initialize(server, channel_name: nil, notification_conditions: []) ⇒ ActionCable
constructor
A new instance of ActionCable.
- #notify(notification, data) ⇒ Object
- #sensitive? ⇒ Boolean
Methods inherited from ProviderBase
Constructor Details
#initialize(server, channel_name: nil, notification_conditions: []) ⇒ ActionCable
Returns a new instance of ActionCable.
8 9 10 11 12 |
# File 'lib/provider/system/action_cable.rb', line 8 def initialize(server, channel_name: nil, notification_conditions: []) super(notification_conditions: notification_conditions) @server = server @channel_name = channel_name end |
Instance Attribute Details
#channel_name ⇒ Object
Returns the value of attribute channel_name.
6 7 8 |
# File 'lib/provider/system/action_cable.rb', line 6 def channel_name @channel_name end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
5 6 7 |
# File 'lib/provider/system/action_cable.rb', line 5 def server @server end |
Instance Method Details
#notify(notification, data) ⇒ Object
14 15 16 17 18 |
# File 'lib/provider/system/action_cable.rb', line 14 def notify(notification, data) return unless can_notify?(notification) server.broadcast channel_name.call(notification), data end |
#sensitive? ⇒ Boolean
20 21 22 |
# File 'lib/provider/system/action_cable.rb', line 20 def sensitive? false end |