Class: BackendAction

Inherits:
Action show all
Defined in:
lib/MINT-core/mapping/action/backend_action.rb

Instance Method Summary collapse

Methods inherited from Action

#finished_callback, #id, #initiated_callback

Constructor Details

#initialize(params) ⇒ BackendAction

BackendAction.new(:call => CUIControl.method(:find_cio_from_coordinates))



3
4
5
6
# File 'lib/MINT-core/mapping/action/backend_action.rb', line 3

def initialize(params)
    super()
    @action = params
end

Instance Method Details

#call_functionObject



14
15
16
# File 'lib/MINT-core/mapping/action/backend_action.rb', line 14

def call_function
  @action[:call]
end

#identifierObject



18
19
20
# File 'lib/MINT-core/mapping/action/backend_action.rb', line 18

def identifier
  call_function.name.to_s
end

#parameterObject



9
10
11
12
# File 'lib/MINT-core/mapping/action/backend_action.rb', line 9

def parameter
  return [] if @action[:parameter].nil?
  @action[:parameter].split(',')
end

#start(observation_results) ⇒ Object



22
23
24
25
26
27
28
29
30
31
# File 'lib/MINT-core/mapping/action/backend_action.rb', line 22

def start(observation_results)
  @result = false
  params = []
  parameter.each { |p|
    params << observation_results[p]
  }

  @result = call_function.call *params
  self
end