Class: Ni::Flows::InlineInteractor
- Includes:
- Utils::HandleWait
- Defined in:
- lib/ni/flows/inline_interactor.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#interactor_klass ⇒ Object
Returns the value of attribute interactor_klass.
-
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
-
#on_failure ⇒ Object
Returns the value of attribute on_failure.
-
#on_terminate ⇒ Object
Returns the value of attribute on_terminate.
Instance Method Summary collapse
- #call(context, params = {}) ⇒ Object
- #call_for_wait_continue(context, params = {}) ⇒ Object
-
#initialize(interactor_klass, action, options = {}) ⇒ InlineInteractor
constructor
A new instance of InlineInteractor.
Methods included from Utils::HandleWait
Constructor Details
#initialize(interactor_klass, action, options = {}) ⇒ InlineInteractor
Returns a new instance of InlineInteractor.
7 8 9 10 11 12 13 |
# File 'lib/ni/flows/inline_interactor.rb', line 7 def initialize(interactor_klass, action, ={}) self.on_cancel = [:on_cancel] self.on_failure = [:on_failure] self.on_terminate = [:on_terminate] self.interactor_klass, self.action = interactor_klass, action end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
5 6 7 |
# File 'lib/ni/flows/inline_interactor.rb', line 5 def action @action end |
#interactor_klass ⇒ Object
Returns the value of attribute interactor_klass.
5 6 7 |
# File 'lib/ni/flows/inline_interactor.rb', line 5 def interactor_klass @interactor_klass end |
#on_cancel ⇒ Object
Returns the value of attribute on_cancel.
5 6 7 |
# File 'lib/ni/flows/inline_interactor.rb', line 5 def on_cancel @on_cancel end |
#on_failure ⇒ Object
Returns the value of attribute on_failure.
5 6 7 |
# File 'lib/ni/flows/inline_interactor.rb', line 5 def on_failure @on_failure end |
#on_terminate ⇒ Object
Returns the value of attribute on_terminate.
5 6 7 |
# File 'lib/ni/flows/inline_interactor.rb', line 5 def on_terminate @on_terminate end |
Instance Method Details
#call(context, params = {}) ⇒ Object
15 16 17 |
# File 'lib/ni/flows/inline_interactor.rb', line 15 def call(context, params={}) interactor_klass.public_send(action, context, params) end |
#call_for_wait_continue(context, params = {}) ⇒ Object
19 20 21 |
# File 'lib/ni/flows/inline_interactor.rb', line 19 def call_for_wait_continue(context, params={}) call(context, params) end |