Class: Rgviz::OrderBy

Inherits:
Object
  • Object
show all
Defined in:
lib/rgviz/nodes.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeOrderBy

Returns a new instance of OrderBy.



95
96
97
# File 'lib/rgviz/nodes.rb', line 95

def initialize
  @sorts = []
end

Instance Attribute Details

#sortsObject

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_sObject



106
107
108
# File 'lib/rgviz/nodes.rb', line 106

def to_s
  @sorts.map(&:to_s).join(', ')
end