Class: SpotFeel::IfExpression

Inherits:
Node
  • Object
show all
Defined in:
lib/spot_feel/nodes.rb

Overview

  1. if expression = “if” , expression , “then” , expression , “else” expression ;

Instance Method Summary collapse

Methods inherited from Node

#qualified_names_in_context, #raise_evaluation_error

Instance Method Details

#eval(context = {}) ⇒ Object



435
436
437
438
439
440
441
# File 'lib/spot_feel/nodes.rb', line 435

def eval(context = {})
  if condition.eval(context)
    true_case.eval(context)
  else
    false_case.eval(context)
  end
end