Class: EventAPIListener

Inherits:
Object
  • Object
show all
Defined in:
app/services/event_api_listener.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(application, event_category, event_name) ⇒ EventAPIListener

Returns a new instance of EventAPIListener.



6
7
8
9
10
11
# File 'app/services/event_api_listener.rb', line 6

def initialize(application, event_category, event_name)
  @application    = application
  @event_category = event_category
  @event_name     = event_name
  Kernel.at_exit { unlisten }
end

Class Method Details

.call(*args) ⇒ Object



116
117
118
# File 'app/services/event_api_listener.rb', line 116

def call(*args)
  new(*args).call
end

Instance Method Details

#callObject



13
14
15
16
# File 'app/services/event_api_listener.rb', line 13

def call
  consumer # Eager load consumer to early detect errors.
  listen
end