Class: Ara::Remote::Server

Inherits:
Object
  • Object
show all
Defined in:
lib/ara/remote.rb

Instance Method Summary collapse

Constructor Details

#initialize(host, port) ⇒ Server

Returns a new instance of Server.



27
28
29
30
31
# File 'lib/ara/remote.rb', line 27

def initialize(host, port)
   @host = host
   @port = port
   @routes = {}
end

Instance Method Details

#register(route, actor) ⇒ Object



33
34
35
36
# File 'lib/ara/remote.rb', line 33

def register(route, actor)
   @routes["/#{route}"] = Rack::ActorMap.new(actor)
   self
end

#startObject



38
39
40
41
42
# File 'lib/ara/remote.rb', line 38

def start
   app = Rack::URLMap.new(@routes)
   app = Rack::ContentLength.new(app)
   Rack::Handler::WEBrick.run( app, {:Port => @port} )
end