Class: PushClient::Subscriber

Inherits:
Communicator show all
Defined in:
lib/push-client.rb

Constant Summary

Constants inherited from Communicator

Communicator::HEADERS

Instance Method Summary collapse

Constructor Details

#initialize(hub) {|_self| ... } ⇒ Subscriber

Returns a new instance of Subscriber.

Yields:

  • (_self)

Yield Parameters:



20
21
22
23
# File 'lib/push-client.rb', line 20

def initialize(hub)
  super(hub)
  yield self if block_given?
end

Instance Method Details

#subscribe(feed, callback, options = {}) ⇒ Object



25
26
27
# File 'lib/push-client.rb', line 25

def subscribe(feed, callback, options = {})
  command('subscribe', feed, callback, options)
end

#unsubscribe(feed, callback, options = {}) ⇒ Object



29
30
31
# File 'lib/push-client.rb', line 29

def unsubscribe(feed, callback, options = {})
  command('unsubscribe', feed, callback, options)
end