Class: TriviaCrack::GameStatistics
- Inherits:
-
Object
- Object
- TriviaCrack::GameStatistics
- Defined in:
- lib/triviacrack/game_statistics.rb
Instance Attribute Summary collapse
-
#categories ⇒ Object
readonly
Public: A hash of category statistics.
-
#challenges_won ⇒ Object
readonly
Public: The total number of challenges won.
-
#correct_answers ⇒ Object
readonly
Public: The number of questions answered correctly.
-
#crowns ⇒ Object
readonly
Public: The list of categories for which crowns have been won.
-
#incorrect_answers ⇒ Object
readonly
Public: The number of questions answered incorrectly.
-
#questions_answered ⇒ Object
readonly
Public: The total number of questions answered.
Instance Method Summary collapse
-
#initialize(correct_answers: nil, incorrect_answers: nil, questions_answered: nil, challenges_won: nil, crowns: nil, categories: nil) ⇒ GameStatistics
constructor
A new instance of GameStatistics.
Constructor Details
#initialize(correct_answers: nil, incorrect_answers: nil, questions_answered: nil, challenges_won: nil, crowns: nil, categories: nil) ⇒ GameStatistics
Returns a new instance of GameStatistics.
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/triviacrack/game_statistics.rb', line 23 def initialize(correct_answers: nil, incorrect_answers: nil, questions_answered: nil, challenges_won: nil, crowns: nil, categories: nil) @correct_answers = correct_answers @incorrect_answers = incorrect_answers @questions_answered = questions_answered @challenges_won = challenges_won @crowns = crowns @categories = categories end |
Instance Attribute Details
#categories ⇒ Object (readonly)
Public: A hash of category statistics.
21 22 23 |
# File 'lib/triviacrack/game_statistics.rb', line 21 def categories @categories end |
#challenges_won ⇒ Object (readonly)
Public: The total number of challenges won.
15 16 17 |
# File 'lib/triviacrack/game_statistics.rb', line 15 def challenges_won @challenges_won end |
#correct_answers ⇒ Object (readonly)
Public: The number of questions answered correctly.
6 7 8 |
# File 'lib/triviacrack/game_statistics.rb', line 6 def correct_answers @correct_answers end |
#crowns ⇒ Object (readonly)
Public: The list of categories for which crowns have been won.
18 19 20 |
# File 'lib/triviacrack/game_statistics.rb', line 18 def crowns @crowns end |
#incorrect_answers ⇒ Object (readonly)
Public: The number of questions answered incorrectly.
9 10 11 |
# File 'lib/triviacrack/game_statistics.rb', line 9 def incorrect_answers @incorrect_answers end |
#questions_answered ⇒ Object (readonly)
Public: The total number of questions answered.
12 13 14 |
# File 'lib/triviacrack/game_statistics.rb', line 12 def questions_answered @questions_answered end |