module Rack::OAuth2
Constants
- VERSION
Public Class Methods
debug() { || ... }
click to toggle source
# File lib/rack/oauth2.rb, line 34 def self.debug(&block) original = self.debugging? self.debugging = true yield ensure self.debugging = original end
debug!()
click to toggle source
# File lib/rack/oauth2.rb, line 31 def self.debug! self.debugging = true end
debugging=(boolean)
click to toggle source
# File lib/rack/oauth2.rb, line 28 def self.debugging=(boolean) @@debugging = boolean end
debugging?()
click to toggle source
# File lib/rack/oauth2.rb, line 25 def self.debugging? @@debugging end
http_client(agent_name = "Rack::OAuth2 (
click to toggle source
# File lib/rack/oauth2.rb, line 43 def self.http_client(agent_name = "Rack::OAuth2 (#{VERSION})", &local_http_config) Faraday.new(headers: {user_agent: agent_name}) do |faraday| faraday.request :url_encoded faraday.request :json faraday.response :json faraday.response :logger, Rack::OAuth2.logger, {bodies: true} if debugging? faraday.adapter Faraday.default_adapter local_http_config&.call(faraday) http_config&.call(faraday) end end
http_config(&block)
click to toggle source
# File lib/rack/oauth2.rb, line 55 def self.http_config(&block) @@http_config ||= block end
logger()
click to toggle source
# File lib/rack/oauth2.rb, line 16 def self.logger @@logger end
logger=(logger)
click to toggle source
# File lib/rack/oauth2.rb, line 19 def self.logger=(logger) @@logger = logger end
reset_http_config!()
click to toggle source
# File lib/rack/oauth2.rb, line 59 def self.reset_http_config! @@http_config = nil end