Class: Twitter::Request::TwitterOAuth
- Inherits:
-
Faraday::Middleware
- Object
- Faraday::Middleware
- Twitter::Request::TwitterOAuth
- Defined in:
- lib/twitter/request/oauth.rb
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, options) ⇒ TwitterOAuth
constructor
A new instance of TwitterOAuth.
Constructor Details
#initialize(app, options) ⇒ TwitterOAuth
Returns a new instance of TwitterOAuth.
20 21 22 |
# File 'lib/twitter/request/oauth.rb', line 20 def initialize(app, ) @app, @options = app, end |
Instance Method Details
#call(env) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/twitter/request/oauth.rb', line 8 def call(env) params = env[:body] || {} signature_params = params params.each do |key, value| signature_params = {} if value.respond_to?(:content_type) end header = SimpleOAuth::Header.new(env[:method], env[:url], signature_params, @options) env[:request_headers]['Authorization'] = header.to_s @app.call(env) end |