79073383

Date: 2024-10-10 08:23:23
Score: 0.5
Natty:
Report link

Found the solution. To dynamically call a function we can use the below:

void execute(){
  stepsApi = load("scripts/steps.groovy")

  Map steps = [upload:[number: "1", type: "module"]]

  steps.each { step, params ->
        stepsApi."$step"(params)
    }
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Self-answer (0.5):
Posted by: Petros