Class: Sinatra::Symphony::Test
- Inherits:
-
Object
- Object
- Sinatra::Symphony::Test
- Defined in:
- lib/sinatra/symphony/test.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Test
constructor
A new instance of Test.
Constructor Details
#initialize(app) ⇒ Test
Returns a new instance of Test.
6 7 8 |
# File 'lib/sinatra/symphony/test.rb', line 6 def initialize app @app = app end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/sinatra/symphony/test.rb', line 10 def call env EM.run do env['async.callback'] = proc {|response| @response = response; EM.stop} catch(:async) {@app.call(env)} end @response end |