Class: Predicator::AST::Ternary

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

Direct Known Subclasses

DateBetween, IntegerBetween

Instance Attribute Summary collapse

Attributes inherited from Node

#left

Instance Method Summary collapse

Methods inherited from Node

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

Constructor Details

#initialize(left, middle, right) ⇒ Ternary

Returns a new instance of Ternary.



168
169
170
171
172
# File 'lib/predicator/ast.rb', line 168

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

Instance Attribute Details

#middleObject

Returns the value of attribute middle.



166
167
168
# File 'lib/predicator/ast.rb', line 166

def middle
  @middle
end

#rightObject

Returns the value of attribute right.



166
167
168
# File 'lib/predicator/ast.rb', line 166

def right
  @right
end

Instance Method Details

#childrenObject



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

def children; [left, middle, right] end