class OmniAuth::Strategies::GPlus

Public Instance Methods

authorize_params() click to toggle source
Calls superclass method
# File lib/omniauth/strategies/gplus.rb, line 46
def authorize_params
  super.tap do |params|
    params['scope'] = format_scopes(params['scope'])
    params['request_visible_actions'] = format_actions(params['request_visible_actions']) if params['request_visible_actions']
    custom_parameters(params)
  end
end

Private Instance Methods

add_key_to_params(params, key) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 76
def add_key_to_params(params, key)
  params[key] = request.params[key] if request.params[key]
end
custom_parameters(params) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 72
def custom_parameters(params)
  %w(scope client_options request_visible_actions access_type).each { |k| add_key_to_params(params, k) }
end
format_action(action) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 60
def format_action(action)
  "http://schemas.google.com/#{action}"
end
format_actions(actions) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 56
def format_actions(actions)
  actions.split(/,\s*/).collect(&method(:format_action)).join(' ')
end
format_scope(scope) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 68
def format_scope(scope)
  "https://www.googleapis.com/auth/#{scope}"
end
format_scopes(scopes) click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 64
def format_scopes(scopes)
  scopes.split(/,\s*/).collect(&method(:format_scope)).join(' ')
end
raw_info() click to toggle source
# File lib/omniauth/strategies/gplus.rb, line 80
def raw_info
  access_token.options[:mode] = :query
  @raw_info ||= access_token.get('userinfo').parsed
end