Class: SAPOCI::Connect::Middleware::BackgroundSearch
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- SAPOCI::Connect::Middleware::BackgroundSearch
- Defined in:
- lib/sapoci/connect/middleware/background_search.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options = {}) ⇒ BackgroundSearch
constructor
A new instance of BackgroundSearch.
Constructor Details
#initialize(app, options = {}) ⇒ BackgroundSearch
Returns a new instance of BackgroundSearch.
5 6 7 8 |
# File 'lib/sapoci/connect/middleware/background_search.rb', line 5 def initialize(app, = {}) @options = super(app) end |
Instance Method Details
#call(env) ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/sapoci/connect/middleware/background_search.rb', line 10 def call(env) @app.call(env).on_complete do |resp| case env[:status] when 200 env[:sapoci] = SAPOCI::Document.from_html(env[:body]) else end end end |