Class: Pubnub::Subscribe
- Inherits:
-
SubscribeEvent
- Object
- Event
- SubscribeEvent
- Pubnub::Subscribe
- Includes:
- Concurrent::Async, Validator::Subscribe
- Defined in:
- lib/pubnub/events/subscribe.rb
Overview
Holds subscribe functionality, beware, most of subscribe 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
- #clear_state ⇒ Object
-
#initialize(options, app) ⇒ Subscribe
constructor
A new instance of Subscribe.
Methods included from Validator::Subscribe
Methods included from Validator::CommonValidator
#validate_origin, #validate_publish_key, #validate_subscribe_key, #validate_user_id
Methods inherited from SubscribeEvent
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 Pubnub::SubscribeEvent::Removing
#remove, #remove_channels, #remove_groups
Methods included from Pubnub::SubscribeEvent::Adding
#add, #add_channels, #add_groups
Methods inherited from Event
#finalized?, #fire, #send_request, #sync?, #uri
Methods included from Event::EFormatter
#format_channels, #format_envelopes, #format_group
Constructor Details
#initialize(options, app) ⇒ Subscribe
Returns a new instance of Subscribe.
9 10 11 12 13 14 15 16 17 18 |
# File 'lib/pubnub/events/subscribe.rb', line 9 def initialize(, app) @event = :subscribe # Override crypto module if custom cipher key has been used. random_iv = .key?(:random_iv) ? [:random_iv] : true [:crypto_module] = Crypto::CryptoModule.new_legacy([:cipher_key], random_iv) if [:cipher_key] super app.apply_state(self) end |
Instance Method Details
#clear_state ⇒ Object
20 21 22 |
# File 'lib/pubnub/events/subscribe.rb', line 20 def clear_state @state = nil end |