Module: PusherFake
- Defined in:
- lib/pusher-fake.rb,
lib/pusher-fake/server.rb,
lib/pusher-fake/channel.rb,
lib/pusher-fake/webhook.rb,
lib/pusher-fake/connection.rb,
lib/pusher-fake/configuration.rb,
lib/pusher-fake/channel/public.rb,
lib/pusher-fake/channel/private.rb,
lib/pusher-fake/channel/presence.rb,
lib/pusher-fake/server/application.rb
Defined Under Namespace
Modules: Channel, Server Classes: Configuration, Connection, Webhook
Constant Summary collapse
- VERSION =
The current version string.
"1.6.0"
Class Method Summary collapse
-
.configuration ⇒ Configuration
Current configuration.
-
.configure {|Configuration| ... } ⇒ Object
Call this method to modify the defaults.
-
.javascript(options = {}) ⇒ String
Convenience method for the JS to override the Pusher client host and port.
- .log(message) ⇒ Object
Class Method Details
.configuration ⇒ Configuration
Returns Current configuration.
30 31 32 |
# File 'lib/pusher-fake.rb', line 30 def self.configuration @configuration ||= Configuration.new end |
.configure {|Configuration| ... } ⇒ Object
Call this method to modify the defaults.
25 26 27 |
# File 'lib/pusher-fake.rb', line 25 def self.configure yield configuration end |
.javascript(options = {}) ⇒ String
Convenience method for the JS to override the Pusher client host and port.
38 39 40 41 42 43 44 45 |
# File 'lib/pusher-fake.rb', line 38 def self.javascript( = {}) arguments = [ configuration.key, configuration.() ].map(&:to_json).join(",") "new Pusher(#{arguments})" end |
.log(message) ⇒ Object
47 48 49 50 51 |
# File 'lib/pusher-fake.rb', line 47 def self.log() if configuration.verbose configuration.logger << "#{}\n" end end |