Class: PgEventstore::EventClassResolver

Inherits:
Object
  • Object
show all
Defined in:
lib/pg_eventstore/event_class_resolver.rb

Instance Method Summary collapse

Instance Method Details

#call(event_type) ⇒ Class

Parameters:

  • event_type (String, nil)

Returns:

  • (Class)


7
8
9
10
11
12
13
14
15
# File 'lib/pg_eventstore/event_class_resolver.rb', line 7

def call(event_type)
  Object.const_get(event_type)
rescue NameError, TypeError
  PgEventstore.logger&.debug("    Unable to resolve class by `\#{event_type}' event type. \\\n    Picking \#{Event} event class to instantiate the event.\n  TEXT\n  Event\nend\n".strip)