Class: Pubnub::Leave

Inherits:
SingleEvent show all
Includes:
Celluloid, Validator::Leave
Defined in:
lib/pubnub/events/leave.rb

Overview

Holds leave functionality

Instance Attribute Summary

Attributes inherited from Event

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

Instance Method Summary collapse

Methods included from Validator::Leave

#validate!, #validate_channel_and_group!

Methods included from Validator::CommonValidator

#validate_origin, #validate_publish_key, #validate_subscribe_key

Methods inherited from Event

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

Constructor Details

#initialize(options, app) ⇒ Leave

Returns a new instance of Leave.



8
9
10
11
# File 'lib/pubnub/events/leave.rb', line 8

def initialize(options, app)
  @event = :leave
  super
end

Instance Method Details

#fireObject



13
14
15
16
17
# File 'lib/pubnub/events/leave.rb', line 13

def fire
  @app.subscriber.remove_subscription(self)
  @app.subscriber.reset
  super
end