Module: EvilEvents::Core::Events::EventExtensions::Hookable Private

Included in:
AbstractEvent
Defined in:
lib/evil_events/core/events/event_extensions/hookable.rb,
lib/evil_events/core/events/event_extensions/hookable/abstract_hook.rb,
lib/evil_events/core/events/event_extensions/hookable/on_error_hook.rb,
lib/evil_events/core/events/event_extensions/hookable/after_emit_hook.rb,
lib/evil_events/core/events/event_extensions/hookable/before_emit_hook.rb

Overview

This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0

Defined Under Namespace

Modules: ClassMethods Classes: AbstractHook, AfterEmitHook, BeforeEmitHook, OnErrorHook

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base_class) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • base_class (Class)

Since:

  • 0.3.0



11
12
13
# File 'lib/evil_events/core/events/event_extensions/hookable.rb', line 11

def included(base_class)
  base_class.extend(ClassMethods)
end

Instance Method Details

#__call_after_hooks__Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0



36
37
38
39
40
# File 'lib/evil_events/core/events/event_extensions/hookable.rb', line 36

def __call_after_hooks__
  self.class.__after_emit_hooks__.each do |hook|
    hook.call(self)
  end
end

#__call_before_hooks__Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 0.3.0



28
29
30
31
32
# File 'lib/evil_events/core/events/event_extensions/hookable.rb', line 28

def __call_before_hooks__
  self.class.__before_emit_hooks__.each do |hook|
    hook.call(self)
  end
end

#__call_on_error_hooks__(error) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Parameters:

  • error (StandardError)

Since:

  • 0.3.0



20
21
22
23
24
# File 'lib/evil_events/core/events/event_extensions/hookable.rb', line 20

def __call_on_error_hooks__(error)
  self.class.__on_error_hooks__.each do |hook|
    hook.call(self, error)
  end
end

#call(source) ⇒ Object

Returns void.

Parameters:

Returns:

  • void



# File 'lib/evil_events/core/events/event_extensions/hookable/after_emit_hook.rb', line 7