Class: Predicator::AST::Ternary

Inherits:
Node
  • Object
show all
Defined in:
lib/predicator/ast.rb

Direct Known Subclasses

Between

Instance Attribute Summary collapse

Attributes inherited from Node

#left

Instance Method Summary collapse

Methods inherited from Node

#each, #literal?, #to_dot, #to_instructions, #to_predicate, #to_s, #type, #variable?

Constructor Details

#initialize(left, middle, right) ⇒ Ternary

Returns a new instance of Ternary.



120
121
122
123
124
# File 'lib/predicator/ast.rb', line 120

def initialize left, middle, right
  super left
  @middle = middle
  @right = right
end

Instance Attribute Details

#middleObject

Returns the value of attribute middle.



118
119
120
# File 'lib/predicator/ast.rb', line 118

def middle
  @middle
end

#rightObject

Returns the value of attribute right.



118
119
120
# File 'lib/predicator/ast.rb', line 118

def right
  @right
end

Instance Method Details

#childrenObject



126
# File 'lib/predicator/ast.rb', line 126

def children; [left, middle, right] end