Sha256: 0272c2831f7d31032162b4013caa3e478e57a21e8570855a843682befede7e4a

Contents?: true

Size: 534 Bytes

Versions: 15

Compression:

Stored size: 534 Bytes

Contents

var PusherBus = Class.extend({
  init: function(config){
    delete config.bus_name
    var key = config.key
    delete config.key
    this.pusher = new Pusher(key, config);
  },
  subscribe: function(subscription){
    this.channel = this.pusher.subscribe(this.get_channel_name(subscription.channel));
    this.channel.bind('publish', function(data){
      subscription.callback(data);
    })
  },
  get_channel_name: function(channel_name){
    return channel_name.replace(/::/g, '.')
  }
})
PusherBus.third_party_library = 'Pusher'

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
foreign_office-0.16.4 app/assets/javascripts/pusher_bus.js
foreign_office-0.16.3 app/assets/javascripts/pusher_bus.js
foreign_office-0.16.2 app/assets/javascripts/pusher_bus.js
foreign_office-0.16.1 app/assets/javascripts/pusher_bus.js
foreign_office-0.16.0 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.12 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.11 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.10 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.9 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.8 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.7 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.6 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.5 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.4 app/assets/javascripts/pusher_bus.js
foreign_office-0.15.3 app/assets/javascripts/pusher_bus.js