Class: Ni::Flows::InlineInteractor

Inherits:
Base
  • Object
show all
Includes:
Utils::HandleWait
Defined in:
lib/ni/flows/inline_interactor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Utils::HandleWait

#handle_current_wait?

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, options={})
  self.on_cancel = options[:on_cancel]
  self.on_failure = options[:on_failure]
  self.on_terminate = options[:on_terminate]

  self.interactor_klass, self.action = interactor_klass, action
end

Instance Attribute Details

#actionObject

Returns the value of attribute action.



5
6
7
# File 'lib/ni/flows/inline_interactor.rb', line 5

def action
  @action
end

#interactor_klassObject

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_cancelObject

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_failureObject

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_terminateObject

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