Sha256: 0cb1e74b64132a7e12aaf80e25a0b92cfe6cc0ca3065646e539f6081e22cc7e9
Contents?: true
Size: 320 Bytes
Versions: 4
Compression:
Stored size: 320 Bytes
Contents
# frozen_string_literal: true module TTFunk class Sum < Aggregate attr_reader :value def initialize(init_value = 0) @value = init_value end def <<(operand) @value += coerce(operand) end def value_or(_default) # value should always be non-nil value end end end
Version data entries
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
ttfunk-1.6.2.1 | lib/ttfunk/sum.rb |
ttfunk-1.6.2 | lib/ttfunk/sum.rb |
ttfunk-1.6.1 | lib/ttfunk/sum.rb |
ttfunk-1.6.0 | lib/ttfunk/sum.rb |