Parent

Methods

Class/Module Index [+]

Quicksearch

Github::Middleware

Public Class Methods

default(options = {}) click to toggle source
# File lib/github_api/middleware.rb, line 10
def self.default(options = {})
  api = options[:api]
  proc do |builder|
    builder.use Github::Request::Jsonize
    builder.use Faraday::Request::Multipart
    builder.use Faraday::Request::UrlEncoded
    builder.use Github::Request::OAuth2, api.oauth_token if api.oauth_token?
    builder.use Github::Request::BasicAuth, api.authentication if api.basic_authed?

    builder.use Faraday::Response::Logger if ENV['DEBUG']
    unless options[:raw]
      builder.use Github::Response::Mashify
      builder.use Github::Response::Jsonize
    end
    builder.use Github::Response::RaiseError
    builder.adapter options[:adapter]
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.