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