Class: Rgviz::WhereVisitor
Instance Attribute Summary
#string
Instance Method Summary
collapse
#<<, #escaped_string, #initialize, #visit_aggregate_column, #visit_boolean_column, #visit_date_column, #visit_date_time_column, #visit_format, #visit_group_by, #visit_id_column, #visit_label, #visit_number_column, #visit_option, #visit_pivot, #visit_scalar_function_column, #visit_string_column, #visit_time_of_day_column
Instance Method Details
#visit_binary_expression(node) ⇒ Object
559
560
561
562
563
564
|
# File 'lib/rgviz_rails/executor.rb', line 559
def visit_binary_expression(node)
node.left.accept self
@string += " #{node.operator} "
node.right.accept self
false
end
|
#visit_logical_expression(node) ⇒ Object
549
550
551
552
553
554
555
556
557
|
# File 'lib/rgviz_rails/executor.rb', line 549
def visit_logical_expression(node)
@string += "("
node.operands.each_with_index do |operand, i|
@string += " #{node.operator} " if i > 0
operand.accept self
end
@string += ")"
false
end
|
#visit_unary_expression(node) ⇒ Object
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
|
# File 'lib/rgviz_rails/executor.rb', line 566
def visit_unary_expression(node)
case node.operator
when UnaryExpression::Not
@string += 'not ('
node.operand.accept self
@string += ')'
when UnaryExpression::IsNull
node.operand.accept self
@string += ' is null'
when UnaryExpression::IsNotNull
node.operand.accept self
@string += ' is not null'
end
false
end
|