Class: TARS::Server

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

Class Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeServer

Returns a new instance of Server.



22
23
24
25
# File 'lib/tars/bot.rb', line 22

def initialize
  @server = WEBrick::HTTPServer.new Port: TARS.config.server[:port]
  @server.mount TARS.config.server[:path], TARS::PostHandler
end

Class Attribute Details

.serverObject (readonly)

Returns the value of attribute server.



19
20
21
# File 'lib/tars/bot.rb', line 19

def server
  @server
end

Instance Method Details

#run!Object



27
28
29
# File 'lib/tars/bot.rb', line 27

def run!
  @server.start
end