module Typhoeus::Request::Callbacks

def execute_callbacks

Other tags:
    Api: - private

Returns:
  • (void) -

Other tags:
    Example: Execute callbacks. -
def execute_callbacks
  callbacks = Typhoeus.on_complete + Typhoeus.on_progress + on_complete + on_progress
  if response && response.success?
    callbacks += Typhoeus.on_success + on_success
  elsif response
    callbacks += Typhoeus.on_failure + on_failure
  end
  callbacks.each do |callback|
    self.response.handled_response = callback.call(self.response)
  end
end

def execute_headers_callbacks(response)

Other tags:
    Api: - private

Returns:
  • (Array) - The results of the on_headers callbacks.
    Other tags:
      Example: Execute callbacks. -
    def execute_headers_callbacks(response)
      (Typhoeus.on_headers + on_headers).map do |callback|
        callback.call(response)
      end
    end