Sha256: 652a6def567b91ba46d36766b0bbfff87696d92b359aaeea817fa652ccf7255e

Contents?: true

Size: 731 Bytes

Versions: 4

Compression:

Stored size: 731 Bytes

Contents

module Alf
  module Sql
    module SelectList
      include Expr

      def desaliaser
        ->(a){
          item = sexpr_body.find{|item| item.as_name.to_s == a.to_s }
          item && item.left
        }
      end

      def is_table_dee?
        Builder::IS_TABLE_DEE == self
      end

      def knows?(as_name)
        find_child{|child| child.as_name == as_name }
      end

      def to_attr_list
        AttrList.coerce(sexpr_body.map{|a| a.as_name })
      end

      def to_sql(buffer = "")
        sexpr_body.each_with_index do |item,index|
          buffer << ", " unless index == 0
          item.to_sql(buffer)
        end
        buffer
      end

    end # module SelectList
  end # module Sql
end # module Alf

Version data entries

4 entries across 4 versions & 1 rubygems

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