Sha256: f1767561c5707f0c5d7154d0fa4e2cdf3c9e167c0968b5df58c2b68de49cf2c3

Contents?: true

Size: 527 Bytes

Versions: 5

Compression:

Stored size: 527 Bytes

Contents

module Alf
  module Sql
    module OrderByClause
      include Expr

      ORDER_BY = "ORDER BY".freeze

      def to_ordering
        @ordering ||= Ordering.new(sexpr_body.map{|x|
          [x.as_name, x.direction]
        })
      end

      def to_sql(buffer = "")
        buffer << ORDER_BY << SPACE
        each_child do |item,index|
          buffer << COMMA << SPACE unless index == 0
          item.to_sql(buffer)
        end
        buffer
      end

    end # module OrderByClause
  end # module Sql
end # module Alf

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
alf-sql-0.16.3 lib/alf/sql/nodes/order_by_clause.rb
alf-sql-0.16.2 lib/alf/sql/nodes/order_by_clause.rb
alf-sql-0.16.1 lib/alf/sql/nodes/order_by_clause.rb
alf-sql-0.16.0 lib/alf/sql/nodes/order_by_clause.rb
alf-sql-0.15.0 lib/alf/sql/nodes/order_by_clause.rb