Method: ActiveWorkflowAgent::Response#add_logs

Defined in:
lib/active_workflow_agent/response.rb

#add_logs(*logs) ⇒ Object

Add log messages to the response object.



18
19
20
21
22
23
24
25
26
27
28
# File 'lib/active_workflow_agent/response.rb', line 18

def add_logs(*logs)
  # Validation.
  must_str = "must be (non-empty) strings"
  not_empty = "can not be empty strings"
  logs.each do |log|
    raise(ArgumentError, "Logs #{must_str}.") unless log.is_a?(String)
    raise(ArgumentError, "Logs #{not_empty}.") if log == ""
  end

  logs.each { |log| @logs << log }
end