Class: RenderSync::Clients::Pusher

Inherits:
Object
  • Object
show all
Defined in:
lib/render_sync/clients/pusher.rb

Defined Under Namespace

Classes: Message

Instance Method Summary collapse

Instance Method Details

#batch_publish(*args) ⇒ Object



24
25
26
# File 'lib/render_sync/clients/pusher.rb', line 24

def batch_publish(*args)
  Message.batch_publish(*args)
end

#build_message(*args) ⇒ Object



28
29
30
# File 'lib/render_sync/clients/pusher.rb', line 28

def build_message(*args)
  Message.new(*args)
end

#normalize_channel(channel) ⇒ Object

Public: Normalize channel to adapter supported format

channel - The string channel name

Returns The normalized channel prefixed with supported format for Pusher



37
38
39
# File 'lib/render_sync/clients/pusher.rb', line 37

def normalize_channel(channel)
  channel
end

#setupObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/render_sync/clients/pusher.rb', line 5

def setup
  require 'pusher'
  ::Pusher.app_id = RenderSync.app_id
  ::Pusher.key    = RenderSync.api_key
  ::Pusher.secret = RenderSync.auth_token

  if RenderSync.pusher_api_scheme
    ::Pusher.scheme = RenderSync.pusher_api_scheme
  end

  if RenderSync.pusher_api_host
    ::Pusher.host = RenderSync.pusher_api_host
  end

  if RenderSync.pusher_api_port
    ::Pusher.port = RenderSync.pusher_api_port
  end
end