Class: DNN::Callbacks::LambdaCallback
- Defined in:
- lib/dnn/core/callbacks.rb
Overview
This callback wrap the lambda function.
Instance Attribute Summary
Attributes inherited from Callback
Instance Method Summary collapse
-
#initialize(event, lambda) ⇒ LambdaCallback
constructor
A new instance of LambdaCallback.
Constructor Details
#initialize(event, lambda) ⇒ LambdaCallback
Returns a new instance of LambdaCallback.
30 31 32 33 34 |
# File 'lib/dnn/core/callbacks.rb', line 30 def initialize(event, lambda) instance_eval do define_singleton_method(event) { lambda.call } end end |