Class: AngellistApi::Request::AngellistApiOAuth

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

Instance Method Summary collapse

Constructor Details

#initialize(app, options) ⇒ AngellistApiOAuth

Returns a new instance of AngellistApiOAuth.



11
12
13
# File 'lib/angellist_api/request/angellist_api_oauth.rb', line 11

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

Instance Method Details

#call(env) ⇒ Object



6
7
8
9
# File 'lib/angellist_api/request/angellist_api_oauth.rb', line 6

def call(env)
  env[:request_headers]['Authorization'] = "Bearer #{@options[:access_token]}" if @options[:access_token]
  @app.call(env)
end