class OmniAuth::Strategies::TeamSnap
Public Instance Methods
raw_info()
click to toggle source
# File lib/omniauth/strategies/teamsnap.rb, line 25 def raw_info @raw_info ||= get_raw_info end
Private Instance Methods
get_raw_info()
click to toggle source
# File lib/omniauth/strategies/teamsnap.rb, line 31 def get_raw_info # TeamSnap /me endpoint is not compatible with standard oauth2 # access_token.get(url).parsed calls because oauth2 doesn't parse # responses with Content-Type: application/vnd.collection+json response = client.connection.get do |req| req.url "https://api.teamsnap.com/v3/me" req.headers["Authorization"] = "Bearer #{access_token.token}" end collection_json = JSON.parse(response.body) collection_json["collection"]["items"].first.fetch("data") end
parse_datum(property)
click to toggle source
# File lib/omniauth/strategies/teamsnap.rb, line 44 def parse_datum(property) raw_info.find { |d| d["name"] == property }.fetch("value") end