Class: ZendeskAPI::Middleware::Response::Callback
- Inherits:
-
Faraday::Response::Middleware
- Object
- Faraday::Response::Middleware
- ZendeskAPI::Middleware::Response::Callback
- Defined in:
- lib/zendesk_api/middleware/response/callback.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, client) ⇒ Callback
constructor
A new instance of Callback.
Constructor Details
#initialize(app, client) ⇒ Callback
Returns a new instance of Callback.
8 9 10 11 |
# File 'lib/zendesk_api/middleware/response/callback.rb', line 8 def initialize(app, client) super(app) @client = client end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 |
# File 'lib/zendesk_api/middleware/response/callback.rb', line 13 def call(env) @app.call(env).on_complete do |env| @client.callbacks.each {|c| c.call(env)} end end |