Class: AngellistApi::Request::Gateway

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

Instance Method Summary collapse

Constructor Details

#initialize(app, gateway) ⇒ Gateway

Returns a new instance of Gateway.



13
14
15
# File 'lib/angellist_api/request/gateway.rb', line 13

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

Instance Method Details

#call(env) ⇒ Object



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

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