Module: Kasket::Events

Defined in:
lib/kasket/events.rb

Overview

Interface to the internal instrumentation event.

Class Method Summary collapse

Class Method Details

.report(event, ar_klass) ⇒ nil

Invokes the configured events callback, if provided.

The callback behaves like a listener, and receives the same arguments that are passed to this ‘report` method.

Parameters:

  • event (String)

    the type of event being instrumented.

  • ar_klass (class)

    the ActiveRecord::Base subclass that the event refers to.

Returns:

  • (nil)


18
19
20
21
22
23
# File 'lib/kasket/events.rb', line 18

def report(event, ar_klass)
  return unless fn

  fn.call(event, ar_klass)
  nil
end