Sha256: ad40abb487026d009844c18dc08f4ceaa484b992397f8d3a12cdecaaf0ea0b21

Contents?: true

Size: 613 Bytes

Versions: 27

Compression:

Stored size: 613 Bytes

Contents

module Bmg
  module Sql
    module SelectItem
      include Expr

      def left
        self[1]
      end

      def right
        self[2]
      end

      def qualifier
        left.qualifier
      end

      def would_be_name
        left.would_be_name
      end

      def as_name
        last.as_name
      end

      def to_sql(buffer, dialect)
        self[1].to_sql(buffer, dialect)
        unless would_be_name == as_name
          buffer << SPACE << AS << SPACE
          last.to_sql(buffer, dialect)
        end
        buffer
      end

    end # module SelectItem
  end # module Sql
end # module Bmg

Version data entries

27 entries across 27 versions & 1 rubygems

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