Class: Spurious::Server::App
- Inherits:
-
EventMachine::Connection
- Object
- EventMachine::Connection
- Spurious::Server::App
- Defined in:
- lib/spurious/server/app.rb
Instance Method Summary collapse
- #docker_host_ip ⇒ Object
-
#initialize(docker_host) ⇒ App
constructor
A new instance of App.
- #receive_data(data) ⇒ Object
Constructor Details
#initialize(docker_host) ⇒ App
Returns a new instance of App.
11 12 13 |
# File 'lib/spurious/server/app.rb', line 11 def initialize(docker_host) @docker_host = docker_host end |
Instance Method Details
#docker_host_ip ⇒ Object
15 16 17 |
# File 'lib/spurious/server/app.rb', line 15 def docker_host_ip @docker_host[/\/\/([0-9\.]+):/,1] end |
#receive_data(data) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/spurious/server/app.rb', line 19 def receive_data data payload = parse_payload data state(payload[:type]).execute! rescue Exception => e puts e. state(:error).tap { |s| s. = "JSON payload malformed" }.execute! end |