Method: Itly#validate

Defined in:
lib/itly/itly.rb

#validate(event:) ⇒ Array

Validate an Event

Call event on all plugins and collect their return values.

Parameters:

  • event: (Event)

    the event to validate

Returns:

  • (Array)

    array of Itly::ValidationResponse objects that were generated by the plugins



328
329
330
331
332
333
334
335
336
337
# File 'lib/itly/itly.rb', line 328

def validate(event:)
  return unless was_initialized? && validation_enabled?

  # Log
  log = Itly::Loggers.vars_to_log event: event
  logger&.info "validate(#{log})"

  # Run on all plugins
  run_on_plugins { |plugin| plugin.validate event: event }
end