ruby impl of calculatestring