Module: ElasticityGrammar::LogicCond1

Defined in:
lib/opennebula/flow/grammar.rb

Instance Method Summary collapse

Instance Method Details

#result(role, vm_pool) ⇒ Object



324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
# File 'lib/opennebula/flow/grammar.rb', line 324

def result(role, vm_pool)
    l_val, l_st = left.result(role, vm_pool)
    r_val, r_st = right.result(role, vm_pool)

    st = "#{l_st} #{comp_op.text_value} #{r_st}"

    if l_val.nil? || r_val.nil?
        # An attribute was not found, we return false instead
        # of assuming a value of 0

        val = false
    else
        val = comp_op.apply(l_val, r_val)
    end

    return [val, st]
end