Class: Jace::Dispatcher Private
- Inherits:
-
Object
- Object
- Jace::Dispatcher
- Defined in:
- lib/jace/dispatcher.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Class responsible for dispatching the call of events
Instance Method Summary collapse
-
#dispatch(context, &block) ⇒ Object
private
Dispatch the event call on a context.
-
#initialize(before: [], after: []) ⇒ Dispatcher
constructor
private
A new instance of Dispatcher.
Constructor Details
#initialize(before: [], after: []) ⇒ Dispatcher
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.
Returns a new instance of Dispatcher.
13 14 15 16 |
# File 'lib/jace/dispatcher.rb', line 13 def initialize(before: [], after: []) @before = [before].flatten.compact @after = [after].flatten.compact end |
Instance Method Details
#dispatch(context, &block) ⇒ 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.
Dispatch the event call on a context
25 26 27 28 29 30 31 32 |
# File 'lib/jace/dispatcher.rb', line 25 def dispatch(context, &block) Executer.call( before: before, after: after, context: context, &block ) end |