class Rack::OauthProxy::Client
Attributes
options[R]
Public Class Methods
new(options = {})
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 9 def initialize(options = {}) @options = options end
Public Instance Methods
fetch(env)
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 13 def fetch(env) request = Request.new(env, options) connection.get(url, request.params, request.header) end
Private Instance Methods
connection()
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 20 def connection @connection ||= Faraday.new(headers: header) do |connection| connection.adapter :net_http connection.response :json end end
header()
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 35 def header { "Host" => host, }.reject {|key, value| value.nil? } end
host()
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 31 def host options[:host] end
url()
click to toggle source
# File lib/rack/oauth_proxy/client.rb, line 27 def url options[:url] or raise NoUrlError end