Class: Restapi::Extractor::Recorder::Middleware
- Inherits:
-
Object
- Object
- Restapi::Extractor::Recorder::Middleware
- Defined in:
- lib/restapi/extractor/recorder.rb
Instance Method Summary collapse
- #analyze(env, &block) ⇒ Object
- #call(env) ⇒ Object
-
#initialize(app) ⇒ Middleware
constructor
A new instance of Middleware.
Constructor Details
#initialize(app) ⇒ Middleware
Returns a new instance of Middleware.
86 87 88 |
# File 'lib/restapi/extractor/recorder.rb', line 86 def initialize(app) @app = app end |
Instance Method Details
#analyze(env, &block) ⇒ Object
96 97 98 99 100 101 102 103 |
# File 'lib/restapi/extractor/recorder.rb', line 96 def analyze(env, &block) Restapi::Extractor.call_recorder.analyse_env(env) response = block.call Restapi::Extractor.call_recorder.analyse_response(response) response ensure Restapi::Extractor.call_finished end |
#call(env) ⇒ Object
90 91 92 93 94 |
# File 'lib/restapi/extractor/recorder.rb', line 90 def call(env) analyze(env) do @app.call(env) end end |