Class: AngellistApi::Request::AngellistApiOAuth
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- AngellistApi::Request::AngellistApiOAuth
- Defined in:
- lib/angellist_api/request/angellist_api_oauth.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ AngellistApiOAuth
constructor
A new instance of AngellistApiOAuth.
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, ) @app, @options = app, 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 |