Sha256: 7c0edc7e93af3dbd8926287bb1c31d44fbb8d5b549949eb7e8a1b068f8e8fb6f

Contents?: true

Size: 336 Bytes

Versions: 3

Compression:

Stored size: 336 Bytes

Contents

require 'faraday'

module Faraday
  class Request::AngellistApiOAuth < Faraday::Middleware
    def call(env)
      env[:request_headers]['Authorization'] = "Bearer #{@options[:access_token]}" if @options[:access_token]
      @app.call(env)
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
angellist_api-1.0.1 lib/faraday/request/angellist_api_oauth.rb
angellist_api-0.1.2 lib/faraday/request/angellist_api_oauth.rb
angellist_api-1.0.0 lib/faraday/request/angellist_api_oauth.rb