Class: OPQ::Bot
- Inherits:
-
Object
- Object
- OPQ::Bot
- Defined in:
- lib/opqr/bot.rb
Instance Attribute Summary collapse
-
#observer ⇒ Object
Returns the value of attribute observer.
-
#ws ⇒ Object
Returns the value of attribute ws.
Instance Method Summary collapse
-
#initialize(api_url, http_port, observers) ⇒ Bot
constructor
A new instance of Bot.
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
#observer ⇒ Object
Returns the value of attribute observer.
7 8 9 |
# File 'lib/opqr/bot.rb', line 7 def observer @observer end |
#ws ⇒ Object
Returns the value of attribute ws.
7 8 9 |
# File 'lib/opqr/bot.rb', line 7 def ws @ws end |