Class: CloudRailSi::ServiceCode::CallFunc

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudrail_si/servicecode/commands/CallFunc.rb

Instance Method Summary collapse

Instance Method Details

#execute(environment, parameters) ⇒ Object



10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/cloudrail_si/servicecode/commands/CallFunc.rb', line 10

def execute(environment, parameters)
    Helper.assert((parameters.length >= 1) &&
                  ((Helper.is_string(parameters[0])) || Helper.is_var_address(parameters[0])))

    function_name = Helper.resolve(environment, parameters[0], true)
    function_name = function_name.to_s if (!Helper.is_string(function_name))
    function_parameters = []

    (1..parameters.length - 1).each do |i|
        function_parameters.push(Helper.resolve(environment, parameters[i], false))
    end

    environment.call_function(function_name, function_parameters)
end

#get_identifierObject



6
7
8
# File 'lib/cloudrail_si/servicecode/commands/CallFunc.rb', line 6

def get_identifier
    'callFunc'
end