Class: Rgviz::BinaryExpression
- Inherits:
-
Object
- Object
- Rgviz::BinaryExpression
- Defined in:
- lib/rgviz/nodes.rb
Constant Summary collapse
- Contains =
Token::Contains
- EndsWith =
:'ends with'
- Eq =
Token::EQ
- Gt =
Token::GT
- Gte =
Token::GTE
- Like =
Token::Like
- Lt =
Token::LT
- Lte =
Token::LTE
- Matches =
Token::Matches
- Neq =
Token::NEQ
- StartsWith =
:'starts with'
Instance Attribute Summary collapse
-
#left ⇒ Object
Returns the value of attribute left.
-
#operator ⇒ Object
Returns the value of attribute operator.
-
#right ⇒ Object
Returns the value of attribute right.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize(left, operator, right) ⇒ BinaryExpression
constructor
A new instance of BinaryExpression.
- #to_s ⇒ Object
Constructor Details
#initialize(left, operator, right) ⇒ BinaryExpression
Returns a new instance of BinaryExpression.
254 255 256 257 258 |
# File 'lib/rgviz/nodes.rb', line 254 def initialize(left, operator, right) @left = left @operator = operator @right = right end |
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
251 252 253 |
# File 'lib/rgviz/nodes.rb', line 251 def left @left end |
#operator ⇒ Object
Returns the value of attribute operator.
250 251 252 |
# File 'lib/rgviz/nodes.rb', line 250 def operator @operator end |
#right ⇒ Object
Returns the value of attribute right.
252 253 254 |
# File 'lib/rgviz/nodes.rb', line 252 def right @right end |
Instance Method Details
#accept(visitor) ⇒ Object
260 261 262 263 264 265 266 |
# File 'lib/rgviz/nodes.rb', line 260 def accept(visitor) if visitor.visit_binary_expression(self) left.accept visitor right.accept visitor end visitor.end_visit_binary_expression self end |
#to_s ⇒ Object
268 269 270 |
# File 'lib/rgviz/nodes.rb', line 268 def to_s "#{left} #{operator} #{right}" end |