Class: Artoo::Api::Server
- Inherits:
-
Reel::Server
- Object
- Reel::Server
- Artoo::Api::Server
- Includes:
- RouteHelpers
- Defined in:
- lib/artoo/api/api.rb
Overview
Artoo API Server provides an interface to communicate with master class and retrieve information about robots being controlled
Instance Method Summary collapse
-
#initialize(host = "127.0.0.1", port = 3000) ⇒ Server
constructor
Create new API server.
-
#on_connection(connection) ⇒ Object
Dispatches connection requests.
Constructor Details
#initialize(host = "127.0.0.1", port = 3000) ⇒ Server
Create new API server
16 17 18 |
# File 'lib/artoo/api/api.rb', line 16 def initialize(host = "127.0.0.1", port = 3000) super(host, port, &method(:on_connection)) end |
Instance Method Details
#on_connection(connection) ⇒ Object
Dispatches connection requests
21 22 23 24 25 |
# File 'lib/artoo/api/api.rb', line 21 def on_connection(connection) while request = connection.request dispatch!(connection, request) end end |