Class: Slanger::PresenceSubscription

Inherits:
Subscription show all
Defined in:
lib/slanger/presence_subscription.rb

Instance Attribute Summary

Attributes inherited from Subscription

#connection, #socket

Instance Method Summary collapse

Methods inherited from Subscription

#initialize

Constructor Details

This class inherits a constructor from Slanger::Subscription

Instance Method Details

#subscribeObject



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/slanger/presence_subscription.rb', line 3

def subscribe
  return handle_invalid_signature if invalid_signature?

  unless channel_data?
    return connection.error({
             message: "presence-channel is a presence channel and subscription must include channel_data",
           })
  end

  channel.subscribe(@msg, callback) { |m| send_message m }
end