Module: Upgrow::Action::Decorator
- Defined in:
- lib/upgrow/action.rb
Overview
Module to be prepended to subclasses of Action. This allows Action to decorate methods implemented by subclasses so they can have additional behaviour.
Instance Method Summary collapse
-
#perform ⇒ Result
Calls the original ‘perform` method of the Action object and returns its Result.
Instance Method Details
#perform ⇒ Result
Calls the original ‘perform` method of the Action object and returns its Result. In case the Action throws a `:failure`, catches and returns its value, which is supposed to be a failed Result generated by the Action.
37 38 39 40 41 42 |
# File 'lib/upgrow/action.rb', line 37 def perform(...) catch(:failure) do super result end end |