lib/danica/sum.rb in danica-2.0.5 vs lib/danica/sum.rb in danica-2.0.6

- old
+ new

@@ -1,9 +1,11 @@ require 'danica/operator/chained' module Danica class Sum < Operator::Chained + default_value :priority, 1 + def +(other) repack(other) end private @@ -15,8 +17,14 @@ def chain_operation(a, b) a + b end alias_method :gnu_symbol, :tex_symbol + + def join_proc(symbol) + proc do |_, value| + value.is_a?(Negative) ? ' ' : " #{symbol} " + end + end end end