Skip to content

Commit 5e3e74e

Browse files
authored
Merge pull request #27 from metrik-tech/feature/ENG-171
feature/eng 171: Add bulk AddArguments for actions
2 parents 41e6332 + 6f15613 commit 5e3e74e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

Src/API/ActionBuilder.luau

+20
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,26 @@ function ActionBuilder.Prototype.AddArgument(self: ActionBuilder, argumentName:
8383
return self
8484
end
8585

86+
function ActionBuilder.Prototype.AddArguments(self: ActionBuilder, arguments: {
87+
[string]: {
88+
Type: ("string" | "number" | "boolean")?,
89+
Description: string?,
90+
Required: boolean?,
91+
Default: any,
92+
}
93+
}): ActionBuilder
94+
for argumentName, argument in arguments do
95+
self:AddArgument(argumentName, {
96+
Type = argument.Type,
97+
Description = argument.Description,
98+
Required = argument.Required,
99+
Default = argument.Default
100+
})
101+
end
102+
103+
return self
104+
end
105+
86106
function ActionBuilder.Prototype.Build(self: ActionBuilder): Action
87107
assert(self.Prototype.Name ~= nil, "Actions are required to have a 'Name', please call ':SetName'")
88108
assert(Action.Instantiated[self.Prototype.Key] == nil, `Action '{self.Prototype.Name}' is a duplicate action!`)

0 commit comments

Comments
 (0)