Sha256: 1d01fc4767660f8e41df788ca293ce7263074eedf5198a8a96d9b15666b62693
Contents?: true
Size: 1010 Bytes
Versions: 1
Compression:
Stored size: 1010 Bytes
Contents
module CodewarsApi class User include Common def initialize(id_or_username) fail 'Username or id is not set' unless id_or_username @response = RequestHelper.get("#{CodewarsApi::API_URL}/users/#{id_or_username}") fail @response.message if @response.code == 500 end def username @response.to_h['username'] end def name @response.to_h['name'] end def honor @response.to_h['honor'] end def clan @response.to_h['clan'] end def leaderboard_position @response.to_h['leaderboardPosition'] end def skills @response.to_h['skills'] end def rank_overall @response.to_h['ranks'].andand['overall'] end def rank_languages @response.to_h['ranks'].andand['languages'] end def katas_authored @response.to_h['codeChallenges'].andand['totalAuthored'] end def katas_completed @response.to_h['codeChallenges'].andand['totalCompleted'] end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
codewars_api-0.3.0 | lib/codewars_api/user.rb |