Class: ContextEventLoggerCallback

Inherits:
ContextEventLogger show all
Defined in:
lib/context_event_logger_callback.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(callable) ⇒ ContextEventLoggerCallback

Returns a new instance of ContextEventLoggerCallback.



6
7
8
# File 'lib/context_event_logger_callback.rb', line 6

def initialize(callable)
  @callable = callable
end

Instance Attribute Details

#callableObject

Returns the value of attribute callable.



4
5
6
# File 'lib/context_event_logger_callback.rb', line 4

def callable
  @callable
end

Instance Method Details

#handle_event(event, data) ⇒ Object



10
11
12
# File 'lib/context_event_logger_callback.rb', line 10

def handle_event(event, data)
  @callable.call(event, data) if @callable.present?
end