Sha256: e0e7e32190fe57f21a57da32cd68f872ade1a9250fd2c9bcc107f9b4babc47f6

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

module Async
  class ResponseHandler < EM::DefaultDeferrable
    attr_reader :last_response, :callback_args

    alias arg callback_args

    def succeed(arg)
      sitehub_response = arg[:downstream_response]
      instance_variable_set(:@arg, arg)
      status, headers, body = *sitehub_response.to_a
      rack_response = Rack::Response.new(body, status, headers)
      instance_variable_set(:@last_response, rack_response)
      EM.stop
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sitehub-0.4.3 spec/support/async/response_handler.rb