Class: CloudRailSi::ServiceCode::Get

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudrail_si/servicecode/commands/Get.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
# File 'lib/cloudrail_si/servicecode/commands/Get.rb', line 10

def execute(environment, parameters)
    Helper.assert(parameters.length >= 2 &&
                  Helper.is_var_address(parameters[0]) &&
                  Helper.is_var_address(parameters[1]))
    target_id = parameters[0]
    container_id_parts = environment.decode_variable_address(parameters[1])

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

    environment.set_variable(target_id, environment.get_variable(container_id_parts))
end

#get_identifierObject



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

def get_identifier
    'get'
end