Sha256: 744fa7e6856b6976b03a2f615b4077a5a553c0725c65d0e127d5217e3316d6bf

Contents?: true

Size: 420 Bytes

Versions: 12

Compression:

Stored size: 420 Bytes

Contents

require "faraday/response"

module ZendeskAPI
  module Middleware
    module Response
      # @private
      class Callback < Faraday::Middleware
        def initialize(app, client)
          super(app)
          @client = client
        end

        def call(env)
          @app.call(env).on_complete do |env|
            @client.callbacks.each { |c| c.call(env) }
          end
        end
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
zendesk_api-3.1.1 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.1.0 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.5 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.4 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.2 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.1 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.0 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-3.0.0.rc1 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-2.0.1 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-2.0.0 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-1.38.0.rc2 lib/zendesk_api/middleware/response/callback.rb
zendesk_api-1.38.0.rc1 lib/zendesk_api/middleware/response/callback.rb