Class: OmniAuth::Strategies::TradeKing

Inherits:
OAuth
  • Object
show all
Defined in:
lib/omniauth/strategies/tradeking.rb

Instance Method Summary collapse

Instance Method Details

#emailObject



39
40
41
# File 'lib/omniauth/strategies/tradeking.rb', line 39

def email
  raw_info['userdata']['userprofile']['entry'].select { |r| r['name'] == 'emailAddress1' }.first['value']
end

#first_nameObject



31
32
33
# File 'lib/omniauth/strategies/tradeking.rb', line 31

def first_name
  raw_info['userdata']['userprofile']['entry'].select { |r| r['name'] == 'primaryFirstName' }.first['value']
end

#last_nameObject



35
36
37
# File 'lib/omniauth/strategies/tradeking.rb', line 35

def last_name
  raw_info['userdata']['userprofile']['entry'].select { |r| r['name'] == 'primaryLastName' }.first['value']
end

#login_idObject



43
44
45
# File 'lib/omniauth/strategies/tradeking.rb', line 43

def 
  raw_info['userdata']['userprofile']['entry'].select { |r| r['name'] == 'login_id' }.first['value']
end

#raw_infoObject



27
28
29
# File 'lib/omniauth/strategies/tradeking.rb', line 27

def raw_info
  @raw_info ||= MultiJson.decode(access_token.get('https://api.tradeking.com/v1/member/profile.json').body)['response']
end