Module: EventMachine::ApnManager

Extended by:
ApnManager
Included in:
ApnManager
Defined in:
lib/em_apn_manager.rb,
lib/em_apn_manager/cli.rb,
lib/em_apn_manager/client.rb,
lib/em_apn_manager/engine.rb,
lib/em_apn_manager/logger.rb,
lib/em_apn_manager/manager.rb,
lib/em_apn_manager/apn_server.rb,
lib/em_apn_manager/connection.rb,
lib/em_apn_manager/notification.rb,
lib/em_apn_manager/error_response.rb,
lib/em_apn_manager/generators/install.rb

Defined Under Namespace

Modules: ApnServer Classes: CLI, Client, Connection, Engine, ErrorResponse, Install, Manager, Notification

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject

Returns the value of attribute config.



11
12
13
# File 'lib/em_apn_manager.rb', line 11

def config
  @config
end

Class Method Details

.loggerObject



7
8
9
# File 'lib/em_apn_manager/logger.rb', line 7

def self.logger
  @logger ||= Logger.new(STDOUT)
end

.logger=(new_logger) ⇒ Object



11
12
13
# File 'lib/em_apn_manager/logger.rb', line 11

def self.logger=(new_logger)
  @logger = new_logger
end

Instance Method Details

#push_notification(options = {}) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/em_apn_manager.rb', line 13

def push_notification options = {}
  # FIXME Check options
  $apn_manager_redis.publish "push-notification", {
    env: options[:env],
    cert: options[:cert],
    token: options[:token],
    message: options[:message]
  }.to_json
end