Class: SmartCore::Operation::Result::Callback
- Defined in:
- lib/smart_core/operation/result/callback.rb
Overview
Constant Summary collapse
- EMPTY_INVOKATION_CONTEXT =
This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.
nil
Instance Method Summary collapse
- #call(context = EMPTY_INVOKATION_CONTEXT) ⇒ Any
- #callback? {|SmartCore::Operation::Result::Callback| ... } ⇒ Boolean
Methods inherited from Basic
#failure?, #fatal?, #initialize, #success?
Constructor Details
This class inherits a constructor from SmartCore::Operation::Result::Basic
Instance Method Details
#call(context = EMPTY_INVOKATION_CONTEXT) ⇒ Any
24 25 26 |
# File 'lib/smart_core/operation/result/callback.rb', line 24 def call(context = EMPTY_INVOKATION_CONTEXT) context == EMPTY_INVOKATION_CONTEXT ? callback.call : context.instance_eval(&callback) end |
#callback? {|SmartCore::Operation::Result::Callback| ... } ⇒ Boolean
33 34 35 |
# File 'lib/smart_core/operation/result/callback.rb', line 33 def callback? true.tap { yield(self) if block_given? } end |