Module: ActiveInteractor::Interactor::Perform
- Included in:
- Base
- Defined in:
- lib/active_interactor/interactor/perform.rb
Overview
Defined Under Namespace
Modules: ClassMethods Classes: Options
Instance Method Summary collapse
-
#deep_dup ⇒ Base
Duplicate an interactor instance as well as it's #options and context instances.
-
#execute_perform ⇒ Object
private
Run the interactor instance's #perform with callbacks and validation.
-
#execute_perform! ⇒ Object
private
Run the interactor instance's #perform with callbacks and validation without rescuing Error::ContextFailure.
-
#options ⇒ Options
Options for the interactor #perform.
-
#perform ⇒ Object
abstract
The steps to run when an interactor is called.
-
#rollback ⇒ Object
abstract
The steps to run when an interactor fails.
-
#with_options(options) ⇒ self
private
Set options for an interactor's #perform.
Instance Method Details
#deep_dup ⇒ Base
Duplicate an interactor instance as well as it's #options and context instances.
177 178 179 |
# File 'lib/active_interactor/interactor/perform.rb', line 177 def deep_dup self.class.new(context.dup).(.dup) end |
#execute_perform ⇒ Object
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.
Run the interactor instance's #perform with callbacks and validation.
171 |
# File 'lib/active_interactor/interactor/perform.rb', line 171 delegate :execute_perform, :execute_perform!, to: :worker |
#execute_perform! ⇒ Object
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.
Run the interactor instance's #perform with callbacks and validation without rescuing Error::ContextFailure.
171 |
# File 'lib/active_interactor/interactor/perform.rb', line 171 delegate :execute_perform, :execute_perform!, to: :worker |
#options ⇒ Options
Options for the interactor #perform
184 185 186 |
# File 'lib/active_interactor/interactor/perform.rb', line 184 def ||= ActiveInteractor::Interactor::Perform::Options.new end |
#perform ⇒ Object
interactors should override #perform with the appropriate steps and context mutations required for the interactor to do its work.
The steps to run when an interactor is called. An interactor's #perform method should never be called directly on an interactor instance and should instead be invoked by the interactor's class method .perform.
206 |
# File 'lib/active_interactor/interactor/perform.rb', line 206 def perform; end |
#rollback ⇒ Object
interactors should override #rollback with the appropriate steps and context mutations required for the interactor to roll back its work.
The steps to run when an interactor fails. An interactor's #rollback method should never be called directly and is instead called by the interactor's context when #fail is called.
232 |
# File 'lib/active_interactor/interactor/perform.rb', line 232 def rollback; end |
#with_options(options) ⇒ self
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.
Set options for an interactor's #perform
240 241 242 243 244 245 246 247 |
# File 'lib/active_interactor/interactor/perform.rb', line 240 def () = if .is_a?(ActiveInteractor::Interactor::Perform::Options) else ActiveInteractor::Interactor::Perform::Options.new() end self end |