Class: ForeignOffice::Busses::PusherBus
- Inherits:
-
GenericBus
- Object
- GenericBus
- ForeignOffice::Busses::PusherBus
- Defined in:
- lib/foreign_office/busses/pusher_bus.rb
Class Method Summary collapse
- .app_id ⇒ Object
- .app_id=(app_id) ⇒ Object
- .config(config) ⇒ Object
- .connection ⇒ Object
- .key ⇒ Object
- .key=(key) ⇒ Object
- .publish(message) ⇒ Object
- .sanitize_channel(channel) ⇒ Object
- .secret ⇒ Object
- .secret=(secret) ⇒ Object
Methods inherited from GenericBus
Class Method Details
.app_id ⇒ Object
11 12 13 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 11 def self.app_id @app_id end |
.app_id=(app_id) ⇒ Object
7 8 9 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 7 def self.app_id=(app_id) @app_id = app_id end |
.config(config) ⇒ Object
2 3 4 5 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 2 def self.config(config) # Pusher now pulls config directly from the ENV Pusher.encrypted = true end |
.connection ⇒ Object
31 32 33 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 31 def self.connection @pusher ||= Pusher end |
.key ⇒ Object
19 20 21 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 19 def self.key @key end |
.key=(key) ⇒ Object
15 16 17 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 15 def self.key=(key) @key = key end |
.publish(message) ⇒ Object
35 36 37 38 39 40 41 42 43 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 35 def self.publish() .symbolize_keys! channel = sanitize_channel([:channel]) self.connection.trigger( channel, 'publish', ) end |
.sanitize_channel(channel) ⇒ Object
45 46 47 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 45 def self.sanitize_channel(channel) channel.gsub(/::/,'.') end |
.secret ⇒ Object
27 28 29 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 27 def self.secret @secret end |
.secret=(secret) ⇒ Object
23 24 25 |
# File 'lib/foreign_office/busses/pusher_bus.rb', line 23 def self.secret=(secret) @secret = secret end |