Class: Tasker::Events::Catalog::CustomEventRegistrar

Inherits:
Object
  • Object
show all
Defined in:
lib/tasker/events/catalog.rb

Overview

Service class to handle custom event registration Reduces complexity by organizing registration logic

Class Method Summary collapse

Class Method Details

.register(event_name, metadata, catalog_instance) ⇒ void

This method returns an undefined value.

Register a custom event with metadata

Parameters:

  • event_name (String)

    The custom event name

  • metadata (Hash)

    Optional metadata about the event

  • catalog_instance (Catalog)

    The catalog instance to update



281
282
283
284
285
286
287
288
# File 'lib/tasker/events/catalog.rb', line 281

def register(event_name, , catalog_instance)
  register_event_name(event_name, catalog_instance)

  # Add to catalog if metadata provided
  return unless .any?

  (event_name, , catalog_instance)
end