Class: Combi::Http::Server
- Inherits:
-
Object
- Object
- Combi::Http::Server
- Defined in:
- lib/combi/buses/http.rb
Instance Method Summary collapse
-
#initialize(bus) ⇒ Server
constructor
A new instance of Server.
- #on_message(request) ⇒ Object
Constructor Details
#initialize(bus) ⇒ Server
Returns a new instance of Server.
10 11 12 |
# File 'lib/combi/buses/http.rb', line 10 def initialize(bus) @bus = bus end |
Instance Method Details
#on_message(request) ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/combi/buses/http.rb', line 14 def (request) path = request.path.split('/') = { "service" => path[1], "kind" => path[2], "payload" => JSON.parse(request.body) } @bus.() end |