add subs command variant

This commit is contained in:
2026-04-13 15:05:52 +03:00
parent 286e79f21a
commit f283d039c1
2 changed files with 50 additions and 2 deletions

View File

@@ -21,6 +21,8 @@ module RubyAlgebra
result += @lhs.is_a?(Array) ? @lhs.join(', ') : @lhs.to_s
if @operation == :diff
result += ' := Diff(' + @operand1.to_s + @operand2.map { |v| ", #{v}"}.join + ')'
elsif @operation == :subs
result += ' := Subs(' + @operand1.to_s + @operand2.map { |variable, value| ", #{variable}=#{value}"}.join + ')'
else
result += ' := ' + @operand1.to_s
case @operation