Class: Rgviz::OrderBy
- Inherits:
-
Object
- Object
- Rgviz::OrderBy
- Defined in:
- lib/rgviz/nodes.rb
Instance Attribute Summary collapse
-
#sorts ⇒ Object
Returns the value of attribute sorts.
Instance Method Summary collapse
- #accept(visitor) ⇒ Object
-
#initialize ⇒ OrderBy
constructor
A new instance of OrderBy.
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ OrderBy
Returns a new instance of OrderBy.
95 96 97 |
# File 'lib/rgviz/nodes.rb', line 95 def initialize @sorts = [] end |
Instance Attribute Details
#sorts ⇒ Object
Returns the value of attribute sorts.
93 94 95 |
# File 'lib/rgviz/nodes.rb', line 93 def sorts @sorts end |
Instance Method Details
#accept(visitor) ⇒ Object
99 100 101 102 103 104 |
# File 'lib/rgviz/nodes.rb', line 99 def accept(visitor) if visitor.visit_order_by(self) sorts.each{|x| x.accept visitor} end visitor.end_visit_order_by self end |
#to_s ⇒ Object
106 107 108 |
# File 'lib/rgviz/nodes.rb', line 106 def to_s @sorts.map(&:to_s).join(', ') end |