Sha256: 460a191b02d284d739bfdc749543f6fb1f6eb9386b0c4ca2ddd64e4d100cc111

Contents?: true

Size: 540 Bytes

Versions: 66

Compression:

Stored size: 540 Bytes

Contents

module Bmg
  module Sql
    module OrderByClause
      include Expr

      ORDER_BY = "ORDER BY".freeze

      def to_ordering
        @ordering ||= sexpr_body.map{|x|
          [x.as_name.to_sym, x.direction.to_sym]
        }
      end

      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

    end # module OrderByClause
  end # module Sql
end # module Bmg

Version data entries

66 entries across 66 versions & 1 rubygems

Version Path
bmg-0.17.2 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.7 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.17.1 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.17.0 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.6 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.5 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.4 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.3 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.2 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.1 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.0 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.0.pre.rc2 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.16.0.pre.rc1 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.15.0 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.6 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.5 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.4 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.3 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.2 lib/bmg/sql/nodes/order_by_clause.rb
bmg-0.14.1 lib/bmg/sql/nodes/order_by_clause.rb