Class: Rgviz::OrderVisitor
- Inherits:
-
ColumnVisitor
- Object
- Visitor
- ColumnVisitor
- Rgviz::OrderVisitor
- Defined in:
- lib/rgviz_rails/executor.rb
Instance Attribute Summary
Attributes inherited from ColumnVisitor
Instance Method Summary collapse
Methods inherited from ColumnVisitor
#<<, #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
Constructor Details
This class inherits a constructor from Rgviz::ColumnVisitor
Instance Method Details
#visit_order_by(node) ⇒ Object
584 585 586 587 588 589 590 |
# File 'lib/rgviz_rails/executor.rb', line 584 def visit_order_by(node) node.sorts.each_with_index do |sort, i| @string += ',' if i > 0 sort.accept self end false end |
#visit_sort(node) ⇒ Object
592 593 594 595 596 |
# File 'lib/rgviz_rails/executor.rb', line 592 def visit_sort(node) node.column.accept self @string += node.order == Sort::Asc ? ' asc' : ' desc' false end |