Method: LoadRunner::Runner#execute

Defined in:
lib/load_runner/runner.rb

#executeObject

Execute all matching handlers based on the input payload. This method populates the ‘#response` object, and returns true on success.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/load_runner/runner.rb', line 14

def execute
  set_environment_vars
  
  @response = opts.dup
  handlers = locate_handlers

  if handlers.empty?
    @response[:matching_handlers] = matching_handlers
    @response[:error] = "Could not find any handler to process this webhook. Please implement one of the 'matching_handlers'."
    return false
  else
    execute_all handlers
    @response[:executed_handlers] = handlers
    return true
  end
end