Class: Slanger::Subscription
- Inherits:
-
Object
- Object
- Slanger::Subscription
- Defined in:
- lib/slanger/subscription.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#connection ⇒ Object
Returns the value of attribute connection.
-
#socket ⇒ Object
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(socket, socket_id, msg) ⇒ Subscription
constructor
A new instance of Subscription.
- #subscribe ⇒ Object
Constructor Details
#initialize(socket, socket_id, msg) ⇒ Subscription
Returns a new instance of Subscription.
6 7 8 9 |
# File 'lib/slanger/subscription.rb', line 6 def initialize(socket, socket_id, msg) @connection = Connection.new socket, socket_id @msg = msg end |
Instance Attribute Details
#connection ⇒ Object
Returns the value of attribute connection.
3 4 5 |
# File 'lib/slanger/subscription.rb', line 3 def connection @connection end |
#socket ⇒ Object
Returns the value of attribute socket.
3 4 5 |
# File 'lib/slanger/subscription.rb', line 3 def socket @socket end |
Instance Method Details
#subscribe ⇒ Object
11 12 13 14 15 |
# File 'lib/slanger/subscription.rb', line 11 def subscribe send_payload channel_id, "pusher_internal:subscription_succeeded" channel.subscribe { |m| m } end |