Class: MineField::Score

Inherits:
Object
  • Object
show all
Defined in:
lib/mine_field/score.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeScore

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

#totalObject (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