Module: TopNotify

Defined in:
lib/top_notify.rb,
lib/top_notify/sign.rb,
lib/top_notify/logger.rb,
lib/top_notify/server.rb,
lib/top_notify/version.rb,
lib/top_notify/consumer.rb,
lib/top_notify/exception.rb,
lib/top_notify/connection.rb

Defined Under Namespace

Modules: Sign Classes: ConfigurationError, ConfigurationNotFoundError, Connection, Consumer, Logger, Server

Constant Summary collapse

TYPE =
{
	200 => {:method => :connected,              :msg => "connect to taobao server"},
	201 => {:method => :heartbreak,             :msg => "receive heartbreak"},
	202 => {:method => :receive_msg,            :msg => "receive msg"},
	203 => {:method => :discard_msg,            :msg => "receive discard msg"},
	101 => {:method => :connect_reach_max_time, :msg => "connection reach max time"},
	102 => {:method => :server_upgrate,         :msg => "taobao server under upgrade"},
	103 => {:method => :server_rehash,          :msg => "taobao server close the connection"},
	104 => {:method => :client_kickoff,         :msg => "client kickoff"},
	105 => {:method => :server_kickoff,         :msg => "server kickoff"},
   0   => {:method => :unknown_msg,            :msg => "unknown msg"}
}
VERSION =
"0.0.1"

Class Method Summary collapse

Class Method Details

.app_keyObject



40
41
42
# File 'lib/top_notify.rb', line 40

def app_key
  @app_key
end

.app_key=(app_key) ⇒ Object



24
25
26
# File 'lib/top_notify.rb', line 24

def app_key=(app_key)
  @app_key = app_key
end

.app_secretObject



44
45
46
# File 'lib/top_notify.rb', line 44

def app_secret
  @app_secret
end

.app_secret=(app_secret) ⇒ Object



28
29
30
# File 'lib/top_notify.rb', line 28

def app_secret=(app_secret)
  @app_secret = app_secret
end

.loggerObject



36
37
38
# File 'lib/top_notify.rb', line 36

def logger
  @logger
end

.logger=(device) ⇒ Object



32
33
34
# File 'lib/top_notify.rb', line 32

def logger=(device)
  @logger = device
end

.service_urlObject



48
49
50
# File 'lib/top_notify.rb', line 48

def service_url
  @service_url ||= 'http://stream.api.taobao.com/stream'
end

.setup {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:

  • _self (TopNotify)

    the object that the method was called on



20
21
22
# File 'lib/top_notify.rb', line 20

def setup
  yield self
end