Sha256: 2c815b8b757cd4f53a12c960eacf4dd0de2e2e2c1b2c0310ba76f182955637ac

Contents?: true

Size: 329 Bytes

Versions: 2

Compression:

Stored size: 329 Bytes

Contents

require 'faraday'

module Evrythng
  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

2 entries across 2 versions & 1 rubygems

Version Path
evrythng-0.1.1 lib/evrythng/request/gateway.rb
evrythng-0.1.0 lib/evrythng/request/gateway.rb