Class: Capybara::Server::Middleware
- Inherits:
-
Object
- Object
- Capybara::Server::Middleware
- Defined in:
- lib/capybara/server.rb
Instance Attribute Summary collapse
-
#error ⇒ Object
Returns the value of attribute error.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
10 11 12 |
# File 'lib/capybara/server.rb', line 10 def initialize(app) @app = app end |
Instance Attribute Details
#error ⇒ Object
Returns the value of attribute error.
8 9 10 |
# File 'lib/capybara/server.rb', line 8 def error @error end |
Instance Method Details
#call(env) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/capybara/server.rb', line 14 def call(env) if env["PATH_INFO"] == "/__identify__" [200, {}, [@app.object_id.to_s]] else begin @app.call(env) rescue *Capybara.server_errors => e @error = e unless @error raise e end end end |