Class: Stats::Sum

Inherits:
StatsType show all
Defined in:
lib/shades/stats.rb

Instance Method Summary collapse

Methods inherited from StatsType

get

Constructor Details

#initialize(d) ⇒ Sum

Returns a new instance of Sum.



24
25
26
# File 'lib/shades/stats.rb', line 24

def initialize(d)
  @val = d
end

Instance Method Details

#add(d) ⇒ Object



28
29
30
# File 'lib/shades/stats.rb', line 28

def add(d)
  @val += d
end

#get_valueObject



40
41
42
# File 'lib/shades/stats.rb', line 40

def get_value
  @val
end

#merge(stat) ⇒ Object



36
37
38
# File 'lib/shades/stats.rb', line 36

def merge(stat)
  @val += stat.get_value
end

#remove(d) ⇒ Object



32
33
34
# File 'lib/shades/stats.rb', line 32

def remove(d)
  @val -= d
end