Class: TriviaCrack::CategoryStatistics
- Inherits:
-
Object
- Object
- TriviaCrack::CategoryStatistics
- Defined in:
- lib/triviacrack/category_statistics.rb
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Public: The category for these statistics (:arts, :geography, etc).
-
#correct ⇒ Object
readonly
Public: The number of questions answered correctly for this category.
-
#incorrect ⇒ Object
readonly
Public: The number of questions answered incorrectly for this category.
-
#worst ⇒ Object
readonly
Public: Boolean indicating whether this is the worst category for the player.
Instance Method Summary collapse
-
#initialize(category: nil, correct: nil, incorrect: nil, worst: nil) ⇒ CategoryStatistics
constructor
A new instance of CategoryStatistics.
Constructor Details
#initialize(category: nil, correct: nil, incorrect: nil, worst: nil) ⇒ CategoryStatistics
Returns a new instance of CategoryStatistics.
19 20 21 22 23 24 |
# File 'lib/triviacrack/category_statistics.rb', line 19 def initialize(category: nil, correct: nil, incorrect: nil, worst: nil) @category = category @correct = correct @incorrect = incorrect @worst = worst end |
Instance Attribute Details
#category ⇒ Object (readonly)
Public: The category for these statistics (:arts, :geography, etc).
7 8 9 |
# File 'lib/triviacrack/category_statistics.rb', line 7 def category @category end |
#correct ⇒ Object (readonly)
Public: The number of questions answered correctly for this category.
10 11 12 |
# File 'lib/triviacrack/category_statistics.rb', line 10 def correct @correct end |
#incorrect ⇒ Object (readonly)
Public: The number of questions answered incorrectly for this category.
13 14 15 |
# File 'lib/triviacrack/category_statistics.rb', line 13 def incorrect @incorrect end |
#worst ⇒ Object (readonly)
Public: Boolean indicating whether this is the worst category for the player.
17 18 19 |
# File 'lib/triviacrack/category_statistics.rb', line 17 def worst @worst end |