Class: Rgviz::BinaryExpression
- Inherits:
-
Object
- Object
- Rgviz::BinaryExpression
- Defined in:
- lib/rgviz/nodes.rb
Constant Summary collapse
- And =
Token::And
- 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
- Or =
Token::Or
- 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.
235 236 237 238 239 |
# File 'lib/rgviz/nodes.rb', line 235 def initialize(left, operator, right) @left = left @operator = operator @right = right end |
Instance Attribute Details
#left ⇒ Object
Returns the value of attribute left.
232 233 234 |
# File 'lib/rgviz/nodes.rb', line 232 def left @left end |
#operator ⇒ Object
Returns the value of attribute operator.
231 232 233 |
# File 'lib/rgviz/nodes.rb', line 231 def operator @operator end |
#right ⇒ Object
Returns the value of attribute right.
233 234 235 |
# File 'lib/rgviz/nodes.rb', line 233 def right @right end |
Instance Method Details
#accept(visitor) ⇒ Object
241 242 243 244 245 246 247 |
# File 'lib/rgviz/nodes.rb', line 241 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
249 250 251 |
# File 'lib/rgviz/nodes.rb', line 249 def to_s "#{left} #{operator} #{right}" end |