Class: CloudRailSi::ServiceCode::Set

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

Instance Method Summary collapse

Instance Method Details

#execute(environment, parameters) ⇒ Object



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

def execute(environment, parameters)
    Helper.assert(parameters.length >= 2 &&
                  Helper.is_var_address(parameters[0]))
    target_var = parameters[0]
    value = Helper.resolve(environment, parameters[1])
    target_var_parts = environment.decode_variable_address(target_var)
    (2..parameters.length - 1).each do |i|
        target_var_parts.push(Helper.resolve(environment, parameters[i]))
    end
    environment.set_variable(target_var_parts, value)
end

#get_identifierObject



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

def get_identifier
    'set'
end