Class: Plasma::Interpreter::IfNode

Inherits:
PlasmaNode show all
Defined in:
lib/plasma/interpreter/plasma_grammarnode.rb

Instance Method Summary collapse

Methods inherited from PlasmaNode

#empty?

Instance Method Details

#evaluate(env) ⇒ Object



274
275
276
277
278
279
280
281
282
# File 'lib/plasma/interpreter/plasma_grammarnode.rb', line 274

def evaluate(env)
  if pred.evaluate(env)
    body.evaluate(env)
  elsif respond_to?(:maybe)
    maybe.other.evaluate(env)
  else
    nil
  end
end