Method: ForemanDeployments::TaskReference#dereference

Defined in:
app/lib/foreman_deployments/task_reference.rb

#dereference(output) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/lib/foreman_deployments/task_reference.rb', line 11

def dereference(output)
  output_keys.each do |key|
    return nil if output.nil?
    if output.is_a?(Hash) || output.is_a?(Dynflow::ExecutionPlan::OutputReference)
      output = output[key]
    else
      output = output.send(key)
    end
  end
  return output
rescue NoMethodError
  return nil
end