Class: Bool::And

Inherits:
Node
  • Object
show all
Defined in:
lib/bool/ast.rb,
ext/bool_ext/ext.c

Instance Attribute Summary collapse

Attributes inherited from Node

#token

Instance Method Summary collapse

Constructor Details

#initialize(token, left, right) ⇒ And

Returns a new instance of And.



30
31
32
33
# File 'lib/bool/ast.rb', line 30

def initialize(token, left, right)
  super(token)
  @left, @right = left, right
end

Instance Attribute Details

#leftObject (readonly)

Returns the value of attribute left.



28
29
30
# File 'lib/bool/ast.rb', line 28

def left
  @left
end

#rightObject (readonly)

Returns the value of attribute right.



28
29
30
# File 'lib/bool/ast.rb', line 28

def right
  @right
end

Instance Method Details

#accept(visitor, arg) ⇒ Object



35
36
37
# File 'lib/bool/ast.rb', line 35

def accept(visitor, arg)
  visitor.visit_and(self, arg)
end