Module: Exekutor::Internal::Callbacks
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/exekutor/internal/callbacks.rb
Overview
Mixin to define callbacks on a class
Defined Under Namespace
Classes: Error, MissingYield
Instance Method Summary collapse
-
#add_callback(type, *args) {|*args| ... } ⇒ Object
Adds a callback.
Instance Method Details
#add_callback(type, *args) {|*args| ... } ⇒ Object
Adds a callback.
38 39 40 41 42 43 44 45 46 |
# File 'lib/exekutor/internal/callbacks.rb', line 38 def add_callback(type, *args, &callback) unless __callback_names.include? type raise Error, "Invalid callback type: #{type} (Expected one of: #{__callback_names.map(&:inspect).join(", ")}" end raise Error, "No callback block supplied" if callback.nil? add_callback! type, args, callback true end |