class TTFunk::Sum
Attributes
value[R]
Public Class Methods
new(init_value = 0)
click to toggle source
Calls superclass method
# File lib/ttfunk/sum.rb, line 7 def initialize(init_value = 0) super() @value = init_value end
Public Instance Methods
<<(operand)
click to toggle source
# File lib/ttfunk/sum.rb, line 12 def <<(operand) @value += coerce(operand) end
value_or(_default)
click to toggle source
# File lib/ttfunk/sum.rb, line 16 def value_or(_default) # value should always be non-nil value end