Class: OPQ::Bot

Inherits:
Object
  • Object
show all
Defined in:
lib/opqr/bot.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_url, http_port, observers) ⇒ Bot

Returns a new instance of Bot.



8
9
10
11
12
13
14
# File 'lib/opqr/bot.rb', line 8

def initialize(api_url, http_port, observers)
  $http_port = http_port
  $api_url = api_url
  @observer = Observer.new(observers)
  puts "[BOT] 正在尝试连接WS,请稍等~"
  @ws = WsServer.new(@observer)
end

Instance Attribute Details

#observerObject

Returns the value of attribute observer.



7
8
9
# File 'lib/opqr/bot.rb', line 7

def observer
  @observer
end

#wsObject

Returns the value of attribute ws.



7
8
9
# File 'lib/opqr/bot.rb', line 7

def ws
  @ws
end