module Bmg::Sql::OrderByClause
Constants
- ORDER_BY
Public Instance Methods
to_ordering()
click to toggle source
# File lib/bmg/sql/nodes/order_by_clause.rb, line 8 def to_ordering @ordering ||= sexpr_body.map{|x| [x.as_name.to_sym, x.direction.to_sym] } end
to_sql(buffer, dialect)
click to toggle source
# File lib/bmg/sql/nodes/order_by_clause.rb, line 14 def to_sql(buffer, dialect) buffer << ORDER_BY << SPACE each_child do |item,index| buffer << COMMA << SPACE unless index == 0 item.to_sql(buffer, dialect) end buffer end