class OmniAuth::Strategies::PrestoDoctor

Constants

BASE_USER_API
SCOPES

Public Instance Methods

photo_id() click to toggle source
# File lib/omniauth/strategies/prestodoctor.rb, line 41
def photo_id
  @raw_photo_id ||= has_scope?(SCOPES[:PHOTO_ID]) ? access_token.get(BASE_USER_API + '/photo_id').parsed : nil
end
raw_info() click to toggle source
# File lib/omniauth/strategies/prestodoctor.rb, line 33
def raw_info
  @raw_info ||= has_scope?(SCOPES[:USER_INFO]) ? access_token.get(BASE_USER_API).parsed : nil
end
recommendation() click to toggle source
# File lib/omniauth/strategies/prestodoctor.rb, line 37
def recommendation
  @raw_rec ||= has_scope?(SCOPES[:RECOMMENDATION]) ? access_token.get(BASE_USER_API + '/recommendation').parsed : nil
end

Private Instance Methods

has_scope?(scope_name) click to toggle source
# File lib/omniauth/strategies/prestodoctor.rb, line 47
def has_scope?(scope_name)
  return false unless access_token.params['scope']
  scopes = access_token.params['scope'].split(' ')
  scopes.include? scope_name
end