class HQTrivia::User::Leaderboard
The User Leaderboard
Class. A user's stats.
Public Class Methods
@param data [JSON] the data. @!visibility private
# File lib/hqtrivia/user/leaderboard.rb, line 5 def initialize(data) @data = data end
Public Instance Methods
This is only based on HQ Trivia I believe. Most likely accurate based on the information. @return [String] the all time ranking.
# File lib/hqtrivia/user/leaderboard.rb, line 50 def alltime_rank @data['alltime']['rank'] end
This is only based on HQ Trivia I believe, and sometimes isn't even accurate! @return [String] the all time total.
# File lib/hqtrivia/user/leaderboard.rb, line 38 def alltime_total @data['alltime']['total'] end
This is only based on HQ Trivia I believe, and sometimes isn't even accurate! @return [String] the all time win count.
# File lib/hqtrivia/user/leaderboard.rb, line 44 def alltime_wins @data['alltime']['wins'] end
@return [Integer, nil] the rank of this user this week, nil if no rank
# File lib/hqtrivia/user/leaderboard.rb, line 30 def rank return nil if @data['rank'] == 101 && @data['wins'] == 0 @data['rank'] end
@return [String] the total earnings
# File lib/hqtrivia/user/leaderboard.rb, line 10 def total @data['total'] end
@return [Integer] the total earnings, in cents.
# File lib/hqtrivia/user/leaderboard.rb, line 15 def total_cents @data['totalCents'] end
@return [String] the amount of unclaimed money!
# File lib/hqtrivia/user/leaderboard.rb, line 20 def unclaimed @data['unclaimed'] end
This is only based on HQ Trivia I believe. Most likely accurate based on the information. @return [String] the weekly ranking.
# File lib/hqtrivia/user/leaderboard.rb, line 68 def weekly_rank @data['weekly']['rank'] end
This is only based on HQ Trivia I believe, and sometimes isn't even accurate! @return [String] the weekly total.
# File lib/hqtrivia/user/leaderboard.rb, line 56 def weekly_total @data['weekly']['total'] end
This is only based on HQ Trivia I believe, and sometimes isn't even accurate! @return [String] the weekly win count.
# File lib/hqtrivia/user/leaderboard.rb, line 62 def weekly_wins @data['weekly']['wins'] end
@return [Integer] the amount of wins on this week's leaderboard
# File lib/hqtrivia/user/leaderboard.rb, line 25 def wins @data['wins'] end