Class: CloudRailSi::ServiceCode::MakeJoinedStream

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

Instance Method Summary collapse

Instance Method Details

#execute(environment, parameters) ⇒ Object



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/cloudrail_si/servicecode/commands/stream/MakeJoinedStream.rb', line 11

def execute(environment, parameters)
    Helper.assert(parameters.length >= 3 &&
                  Helper.is_var_address(parameters[0]))
    result_var = parameters[0]
    source = Helper.resolve(environment, parameters[1])
    Helper.assert(Helper.is_stream(source))

    stream_stack = []
    (0..parameters.length - 1).each do |i|
        stream_1 = Helper.resolve(environment, parameters[i])
        Helper.assert(Helper.is_stream(stream_1))
        stream_stack.push(stream_1)
    end
    result = join_streams(stream_stack)
    environment.set_variable(result_var, result)
end

#get_identifierObject



7
8
9
# File 'lib/cloudrail_si/servicecode/commands/stream/MakeJoinedStream.rb', line 7

def get_identifier
    'stream.makeJoinedStream'
end