Class: Request::Gateway

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/faraday/request/gateway.rb

Instance Method Summary collapse

Constructor Details

#initialize(app, gateway) ⇒ Gateway

Returns a new instance of Gateway.



14
15
16
# File 'lib/faraday/request/gateway.rb', line 14

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

Instance Method Details

#call(env) ⇒ Object



7
8
9
10
11
12
# File 'lib/faraday/request/gateway.rb', line 7

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