Sha256: b5f616ac455551f06997495400abbe1474cf65408caa9a96396d8549110fa9ae

Contents?: true

Size: 327 Bytes

Versions: 5

Compression:

Stored size: 327 Bytes

Contents

require 'faraday'

module Capgun
  module Request
    class Gateway < Faraday::Middleware

      def call(env)
        url = env[:url].dup
        url.host = @gateway
        env[:url] = url
        @app.call(env)
      end

      def initialize(app, gateway)
        @app, @gateway = app, gateway
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
capgun-0.2.0 lib/capgun/request/gateway.rb
capgun-0.1.2 lib/capgun/request/gateway.rb
capgun-0.1.1 lib/capgun/request/gateway.rb
capgun-0.1.0 lib/capgun/request/gateway.rb
capgun-0.0.3 lib/capgun/request/gateway.rb