Module: Pusher

Extended by:
Forwardable
Defined in:
lib/pusher.rb,
lib/pusher/client.rb,
lib/pusher/channel.rb,
lib/pusher/request.rb,
lib/pusher/webhook.rb

Overview

Used for configuring API credentials and creating Channel objects

Defined Under Namespace

Classes: AuthenticationError, Channel, Client, ConfigurationError, Error, HTTPError, Request, WebHook

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.loggerObject



50
51
52
53
54
55
56
# File 'lib/pusher.rb', line 50

def logger
  @logger ||= begin
    log = Logger.new($stdout)
    log.level = Logger::INFO
    log
  end
end

Class Method Details

.[](channel_name) ⇒ Channel

Return a channel by name

Examples:

Pusher['my-channel']

Returns:

Raises:



42
43
44
45
46
47
48
# File 'lib/pusher.rb', line 42

def [](channel_name)
  begin
    default_client[channel_name]
  rescue ConfigurationError
    raise ConfigurationError, 'Missing configuration: please check that Pusher.key, Pusher.secret and Pusher.app_id are configured.'
  end
end