Class: Callbacker::Initiator
- Inherits:
-
Object
- Object
- Callbacker::Initiator
- Defined in:
- lib/callbacker/initiator.rb
Overview
The Initiator class is used to create a callback that can be attached to a class that includes the Callbackable module.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(**args) ⇒ Initiator
constructor
Initializes an instance of the class with the arguments that will be passed to the callback.
-
#initiate ⇒ Object
Performs the initiation of the callback.
Constructor Details
#initialize(**args) ⇒ Initiator
Initializes an instance of the class with the arguments that will be passed to the callback.
15 16 17 |
# File 'lib/callbacker/initiator.rb', line 15 def initialize(**args) @args = args end |
Class Method Details
.call ⇒ Object
6 7 8 |
# File 'lib/callbacker/initiator.rb', line 6 def call ->(**args) { new(**args).initiate } end |
Instance Method Details
#initiate ⇒ Object
Performs the initiation of the callback.
20 21 22 |
# File 'lib/callbacker/initiator.rb', line 20 def initiate raise NotImplementedError 'You must implement the #initiate method.' end |