Class: MineField::Score
- Inherits:
-
Object
- Object
- MineField::Score
- Defined in:
- lib/mine_field/score.rb
Instance Attribute Summary collapse
-
#total ⇒ Object
readonly
Returns the value of attribute total.
Instance Method Summary collapse
- #increment(score = 1) ⇒ Object
-
#initialize ⇒ Score
constructor
A new instance of Score.
Constructor Details
#initialize ⇒ Score
Returns a new instance of Score.
5 6 7 |
# File 'lib/mine_field/score.rb', line 5 def initialize @total = 0 end |
Instance Attribute Details
#total ⇒ Object (readonly)
Returns the value of attribute total.
3 4 5 |
# File 'lib/mine_field/score.rb', line 3 def total @total end |
Instance Method Details
#increment(score = 1) ⇒ Object
9 10 11 |
# File 'lib/mine_field/score.rb', line 9 def increment(score = 1) @total += score end |