Skip to content

Commit e3779dd

Browse files
Create LogVarMethod.cs
1 parent 6625cb7 commit e3779dd

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using JetBrains.Annotations;
2+
using SER.Code.ArgumentSystem.Arguments;
3+
using SER.Code.ArgumentSystem.BaseArguments;
4+
using SER.Code.MethodSystem.BaseMethods;
5+
using SER.Code.ValueSystem;
6+
using SER.Code.VariableSystem.Variables;
7+
8+
namespace SER.Code.MethodSystem.Methods.VariableMethods;
9+
10+
[UsedImplicitly]
11+
public class LogVarMethod : ReturningMethod<TextValue>
12+
{
13+
public override string Description => "Returns a formatted version of the variable for logging purposes.";
14+
15+
public override Argument[] ExpectedArguments { get; } =
16+
[
17+
new VariableArgument<LiteralVariable>("variable")
18+
];
19+
20+
public override void Execute()
21+
{
22+
var variable = Args.GetVariable<LiteralVariable>("variable");
23+
ReturnValue = $"{variable} = {variable.Value}";
24+
}
25+
}

0 commit comments

Comments
 (0)