Class: Hanami::Utils::Callbacks::Factory Private
- Inherits:
-
Object
- Object
- Hanami::Utils::Callbacks::Factory
- Defined in:
- lib/hanami/utils/callbacks.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.
Callback factory
Class Method Summary collapse
-
.fabricate(callback) ⇒ Callback, MethodCallback
private
Instantiates a ‘Callback` according to if it responds to #call.
Class Method Details
.fabricate(callback) ⇒ Callback, MethodCallback
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.
Instantiates a ‘Callback` according to if it responds to #call.
226 227 228 229 230 231 232 |
# File 'lib/hanami/utils/callbacks.rb', line 226 def self.fabricate(callback) if callback.respond_to?(:call) Callback.new(callback) else MethodCallback.new(callback) end end |