Class: Pubnub::Presence

Inherits:
SubscribeEvent show all
Includes:
Concurrent::Async, Validator::Presence
Defined in:
lib/pubnub/events/presence.rb

Overview

Holds presence functionality, beware, most of presence functionality is held by SubscribeEvent

Instance Attribute Summary

Attributes inherited from SubscribeEvent

#c_cb_pool, #channel, #g_cb_pool, #group, #heart, #wc_cb_pool, #wildcard_channel

Attributes inherited from Event

#callback, #channel, #channel_group, #fresh_clone, #given_options, #group, #idle_timeout, #open_timeout, #origin, #presence_callback, #read_timeout, #ssl, #state, #wildcard_channel, #with_presence

Instance Method Summary collapse

Methods included from Validator::Presence

#validate!

Methods included from Validator::CommonValidator

#validate_origin, #validate_publish_key, #validate_subscribe_key, #validate_user_id

Methods inherited from SubscribeEvent

#build, #fire, #leave_all

Methods included from Formatter

channels_for_url, classify_method, encode, format_channel, format_group, format_message, format_presence_channel, format_uuid, make_channel_array, make_uuid_array, params_hash_to_url_params, parse_json

Methods included from SubscribeEvent::Removing

#remove, #remove_channels, #remove_groups

Methods included from SubscribeEvent::Adding

#add, #add_channels, #add_groups

Methods inherited from Event

#finalized?, #fire, #send_request, #sync?, #uri

Methods included from Event::EFormatter

#format_envelopes, #format_group

Constructor Details

#initialize(options, app) ⇒ Presence

Returns a new instance of Presence.



9
10
11
12
13
# File 'lib/pubnub/events/presence.rb', line 9

def initialize(options, app)
  @event = :presence
  @telemetry_name = :l_pres
  super
end

Instance Method Details

#format_channelsObject



15
16
17
18
# File 'lib/pubnub/events/presence.rb', line 15

def format_channels
  @channel = Formatter.format_channel(@channel || @channels, true)
  @channel = @channel.map { |c| c + '-pnpres' }
end