Class: Artoo::Api
- Inherits:
-
Reel::Server
- Object
- Reel::Server
- Artoo::Api
- Includes:
- ApiRouteHelpers
- Defined in:
- lib/artoo/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) ⇒ Api
constructor
Create new API server.
-
#on_connection(connection) ⇒ Object
Dispatches connection requests.
Constructor Details
#initialize(host = "127.0.0.1", port = 3000) ⇒ Api
Create new API server
15 16 17 |
# File 'lib/artoo/api.rb', line 15 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
20 21 22 23 24 |
# File 'lib/artoo/api.rb', line 20 def on_connection(connection) while request = connection.request dispatch!(connection, request) end end |