Class: TriviaCrack::Profile
- Inherits:
-
Object
- Object
- TriviaCrack::Profile
- Defined in:
- lib/triviacrack/profile.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Public: A hash of TriviaCrack::CategoryStatistics, containing the user’s statistics for individual categories.
-
#challenges_lost ⇒ Object
readonly
Public: Number of challenges lost by the user.
-
#challenges_won ⇒ Object
readonly
Public: Number of challenges won by the user.
-
#consecutive_answers_correct ⇒ Object
readonly
Public: Number of consecutive correctly answered questions by the user.
-
#consecutive_games_won ⇒ Object
readonly
Public: Number of consecutive games won by the user.
-
#country ⇒ Object
readonly
Public: The user’s country (e.g. :ca, :us).
-
#email ⇒ Object
readonly
Public: The user’s email address.
-
#facebook_name ⇒ Object
readonly
Public: The user’s Facebook name.
-
#games_lost ⇒ Object
readonly
Public: Number of games lost by the user.
-
#games_resigned ⇒ Object
readonly
Public: Number of games resigned by the user.
-
#games_won ⇒ Object
readonly
Public: Number of games won by the user.
-
#id ⇒ Object
readonly
Public: The unique identifier of the user.
-
#is_blocked ⇒ Object
readonly
Public: Boolean indicating whether you have blocked the user.
-
#is_friend ⇒ Object
readonly
Public: Boolean indicating whether the user is your friend.
-
#last_login ⇒ Object
readonly
Public: The datetime of the user’s last login.
-
#last_play ⇒ Object
readonly
Public: The datetime of the user’s last play.
-
#level ⇒ Object
readonly
Public: The user’s level.
-
#my_losses_vs_user ⇒ Object
readonly
Public: Number of games lost against the requesting user.
-
#my_wins_vs_user ⇒ Object
readonly
Public: Number of games won against the requesting user.
-
#username ⇒ Object
readonly
Public: The user’s username.
Instance Method Summary collapse
Constructor Details
#initialize(id: nil, facebook_name: nil, is_friend: nil, is_blocked: nil, username: nil, country: nil, email: nil, last_play: nil, last_login: nil, games_won: nil, games_lost: nil, games_resigned: nil, consecutive_games_won: nil, consecutive_answers_correct: nil, level: nil, challenges_won: nil, challenges_lost: nil, categories: nil, my_wins_vs_user: nil, my_losses_vs_user: nil) ⇒ Profile
Returns a new instance of Profile.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 |
# File 'lib/triviacrack/profile.rb', line 66 def initialize(id: nil, facebook_name: nil, is_friend: nil, is_blocked: nil, username: nil, country: nil, email: nil, last_play: nil, last_login: nil, games_won: nil, games_lost: nil, games_resigned: nil, consecutive_games_won: nil, consecutive_answers_correct: nil, level: nil, challenges_won: nil, challenges_lost: nil, categories: nil, my_wins_vs_user: nil, my_losses_vs_user: nil) @id = id @facebook_name = facebook_name @is_friend = is_friend @is_blocked = is_blocked @username = username @country = country @email = email @last_play = last_play @last_login = last_login @games_won = games_won @games_lost = games_lost @games_resigned = games_resigned @consecutive_games_won = consecutive_games_won @consecutive_answers_correct = consecutive_answers_correct @level = level @challenges_won = challenges_won @challenges_lost = challenges_lost @categories = categories @my_wins_vs_user = my_wins_vs_user @my_losses_vs_user = my_losses_vs_user end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Public: A hash of TriviaCrack::CategoryStatistics, containing the user’s statistics for individual categories.
58 59 60 |
# File 'lib/triviacrack/profile.rb', line 58 def categories @categories end |
#challenges_lost ⇒ Object (readonly)
Public: Number of challenges lost by the user.
54 55 56 |
# File 'lib/triviacrack/profile.rb', line 54 def challenges_lost @challenges_lost end |
#challenges_won ⇒ Object (readonly)
Public: Number of challenges won by the user.
51 52 53 |
# File 'lib/triviacrack/profile.rb', line 51 def challenges_won @challenges_won end |
#consecutive_answers_correct ⇒ Object (readonly)
Public: Number of consecutive correctly answered questions by the user.
45 46 47 |
# File 'lib/triviacrack/profile.rb', line 45 def consecutive_answers_correct @consecutive_answers_correct end |
#consecutive_games_won ⇒ Object (readonly)
Public: Number of consecutive games won by the user.
42 43 44 |
# File 'lib/triviacrack/profile.rb', line 42 def consecutive_games_won @consecutive_games_won end |
#country ⇒ Object (readonly)
Public: The user’s country (e.g. :ca, :us).
21 22 23 |
# File 'lib/triviacrack/profile.rb', line 21 def country @country end |
#email ⇒ Object (readonly)
Public: The user’s email address.
24 25 26 |
# File 'lib/triviacrack/profile.rb', line 24 def email @email end |
#facebook_name ⇒ Object (readonly)
Public: The user’s Facebook name.
9 10 11 |
# File 'lib/triviacrack/profile.rb', line 9 def facebook_name @facebook_name end |
#games_lost ⇒ Object (readonly)
Public: Number of games lost by the user.
36 37 38 |
# File 'lib/triviacrack/profile.rb', line 36 def games_lost @games_lost end |
#games_resigned ⇒ Object (readonly)
Public: Number of games resigned by the user.
39 40 41 |
# File 'lib/triviacrack/profile.rb', line 39 def games_resigned @games_resigned end |
#games_won ⇒ Object (readonly)
Public: Number of games won by the user.
33 34 35 |
# File 'lib/triviacrack/profile.rb', line 33 def games_won @games_won end |
#id ⇒ Object (readonly)
Public: The unique identifier of the user.
6 7 8 |
# File 'lib/triviacrack/profile.rb', line 6 def id @id end |
#is_blocked ⇒ Object (readonly)
Public: Boolean indicating whether you have blocked the user.
15 16 17 |
# File 'lib/triviacrack/profile.rb', line 15 def is_blocked @is_blocked end |
#is_friend ⇒ Object (readonly)
Public: Boolean indicating whether the user is your friend.
12 13 14 |
# File 'lib/triviacrack/profile.rb', line 12 def is_friend @is_friend end |
#last_login ⇒ Object (readonly)
Public: The datetime of the user’s last login.
30 31 32 |
# File 'lib/triviacrack/profile.rb', line 30 def last_login @last_login end |
#last_play ⇒ Object (readonly)
Public: The datetime of the user’s last play.
27 28 29 |
# File 'lib/triviacrack/profile.rb', line 27 def last_play @last_play end |
#level ⇒ Object (readonly)
Public: The user’s level.
48 49 50 |
# File 'lib/triviacrack/profile.rb', line 48 def level @level end |
#my_losses_vs_user ⇒ Object (readonly)
Public: Number of games lost against the requesting user.
64 65 66 |
# File 'lib/triviacrack/profile.rb', line 64 def my_losses_vs_user @my_losses_vs_user end |
#my_wins_vs_user ⇒ Object (readonly)
Public: Number of games won against the requesting user.
61 62 63 |
# File 'lib/triviacrack/profile.rb', line 61 def my_wins_vs_user @my_wins_vs_user end |
#username ⇒ Object (readonly)
Public: The user’s username.
18 19 20 |
# File 'lib/triviacrack/profile.rb', line 18 def username @username end |