Class: FrCable::Channel::Base
- Inherits:
-
Object
- Object
- FrCable::Channel::Base
- Defined in:
- lib/fr_cable/channel/base.rb
Instance Attribute Summary collapse
-
#broadcasted_room ⇒ Object
readonly
Returns the value of attribute broadcasted_room.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Class Method Summary collapse
Instance Method Summary collapse
- #broadcast(room, message) ⇒ Object
-
#initialize(_params) ⇒ Base
constructor
A new instance of Base.
- #receive(message) ⇒ Object
- #subscribed(connection_uuid) ⇒ Object
- #unsubscribed ⇒ Object
Constructor Details
#initialize(_params) ⇒ Base
Returns a new instance of Base.
15 16 17 18 |
# File 'lib/fr_cable/channel/base.rb', line 15 def initialize _params @params = _params @broadcasted_room = nil end |
Instance Attribute Details
#broadcasted_room ⇒ Object (readonly)
Returns the value of attribute broadcasted_room.
5 6 7 |
# File 'lib/fr_cable/channel/base.rb', line 5 def broadcasted_room @broadcasted_room end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'lib/fr_cable/channel/base.rb', line 5 def params @params end |
Class Method Details
Instance Method Details
#broadcast(room, message) ⇒ Object
11 12 13 |
# File 'lib/fr_cable/channel/base.rb', line 11 def broadcast(room, ) ::FrCable::Channel::Base.broadcast("#{self.class.name}:#{room}", ) end |
#receive(message) ⇒ Object
20 21 22 |
# File 'lib/fr_cable/channel/base.rb', line 20 def receive # void end |
#subscribed(connection_uuid) ⇒ Object
24 25 26 |
# File 'lib/fr_cable/channel/base.rb', line 24 def subscribed connection_uuid true end |
#unsubscribed ⇒ Object
28 29 30 |
# File 'lib/fr_cable/channel/base.rb', line 28 def unsubscribed # void end |