Class: Healthyr::EventHandler

Inherits:
Object
  • Object
show all
Defined in:
lib/healthyr/event_handler.rb

Constant Summary collapse

EVENT_NAMES =
/sql\.active_record|!render_template\.action_view|process_action\.action_controller/

Instance Method Summary collapse

Constructor Details

#initializeEventHandler

Returns a new instance of EventHandler.



5
6
7
8
9
# File 'lib/healthyr/event_handler.rb', line 5

def initialize
  ActiveSupport::Notifications.subscribe(EVENT_NAMES) do |*args|
    event_received(Event.new(*args))
  end
end

Instance Method Details

#event_received(event) ⇒ Object



11
12
13
# File 'lib/healthyr/event_handler.rb', line 11

def event_received(event)
  EventPool.add(event)
end