Scriban.Helpers.ScriptTimeSpan.IScriptCustomType C# (CSharp) Method

IScriptCustomType() private method

private IScriptCustomType ( ScriptUnaryExpression expression ) : object
expression Scriban.Runtime.ScriptUnaryExpression
return object
        object IScriptCustomType.EvaluateUnaryExpression(ScriptUnaryExpression expression)
        {
            switch (expression.Operator)
            {
                case ScriptUnaryOperator.Negate:
                    return (ScriptTimeSpan)value.Negate();
                case ScriptUnaryOperator.Not:
                    return value == TimeSpan.Zero;
                default:
                    throw new ScriptRuntimeException(expression.Span, $"Operator [{expression.Operator}] is not supported for timespan");
            }
        }

Same methods

ScriptTimeSpan::IScriptCustomType ( Type destinationType, object &outValue ) : bool
ScriptTimeSpan::IScriptCustomType ( ScriptBinaryExpression expression, object left, object right ) : object