Class: ZendeskAPI::Middleware::Response::Callback

Inherits:
Faraday::Response::Middleware
  • Object
show all
Defined in:
lib/zendesk_api/middleware/response/callback.rb

Instance Method Summary collapse

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