Class: ContextEventLoggerCallback
- Inherits:
-
ContextEventLogger
- Object
- ContextEventLogger
- ContextEventLoggerCallback
- Defined in:
- lib/context_event_logger_callback.rb
Instance Attribute Summary collapse
-
#callable ⇒ Object
Returns the value of attribute callable.
Instance Method Summary collapse
- #handle_event(event, data) ⇒ Object
-
#initialize(callable) ⇒ ContextEventLoggerCallback
constructor
A new instance of ContextEventLoggerCallback.
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
#callable ⇒ Object
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 |