Class: FaradayMiddleware::YoutubeOAuth2
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- FaradayMiddleware::YoutubeOAuth2
- Defined in:
- lib/tubeclip/middleware/faraday_oauth2.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, access_token) ⇒ YoutubeOAuth2
constructor
A new instance of YoutubeOAuth2.
Constructor Details
#initialize(app, access_token) ⇒ YoutubeOAuth2
Returns a new instance of YoutubeOAuth2.
9 10 11 |
# File 'lib/tubeclip/middleware/faraday_oauth2.rb', line 9 def initialize(app, access_token) @app, @access_token = app, access_token end |
Instance Method Details
#call(env) ⇒ Object
3 4 5 6 7 |
# File 'lib/tubeclip/middleware/faraday_oauth2.rb', line 3 def call(env) env[:request_headers]['Authorization'] = "Bearer #{@access_token.token}" @app.call(env) end |