Sha256: e7586e444ac10390161efdc75805a21ec2e2a505db02fc9cea3767a66385735f

Contents?: true

Size: 745 Bytes

Versions: 40

Compression:

Stored size: 745 Bytes

Contents

module Bmg
  module Sql
    module Join
      include Expr

      JOIN  = "JOIN".freeze
      ON    = "ON".freeze

      def type
        nil
      end

      def join?
        true
      end

      def left
        self[1]
      end

      def right
        self[2]
      end

      def predicate
        last
      end

      def to_sql(buffer, dialect)
        left.to_sql(buffer, dialect)
        if type.nil?
          buffer << SPACE << JOIN << SPACE
        else
          buffer << SPACE << TYPE << SPACE << JOIN << SPACE
        end
        right.to_sql(buffer, dialect)
        buffer << SPACE << ON << SPACE
        predicate.to_sql(buffer, dialect)
        buffer
      end

    end # module Join
  end # module Sql
end # module Bmg

Version data entries

40 entries across 40 versions & 1 rubygems

Version Path
bmg-0.23.3 lib/bmg/sql/nodes/join.rb
bmg-0.23.2 lib/bmg/sql/nodes/join.rb
bmg-0.23.1 lib/bmg/sql/nodes/join.rb
bmg-0.23.0 lib/bmg/sql/nodes/join.rb
bmg-0.21.5 lib/bmg/sql/nodes/join.rb
bmg-0.21.4 lib/bmg/sql/nodes/join.rb
bmg-0.20.5 lib/bmg/sql/nodes/join.rb
bmg-0.19.3 lib/bmg/sql/nodes/join.rb
bmg-0.21.3 lib/bmg/sql/nodes/join.rb
bmg-0.21.2 lib/bmg/sql/nodes/join.rb
bmg-0.21.0 lib/bmg/sql/nodes/join.rb
bmg-0.20.4 lib/bmg/sql/nodes/join.rb
bmg-0.20.2 lib/bmg/sql/nodes/join.rb
bmg-0.20.1 lib/bmg/sql/nodes/join.rb
bmg-0.20.0 lib/bmg/sql/nodes/join.rb
bmg-0.19.2 lib/bmg/sql/nodes/join.rb
bmg-0.19.1 lib/bmg/sql/nodes/join.rb
bmg-0.19.0 lib/bmg/sql/nodes/join.rb
bmg-0.18.15 lib/bmg/sql/nodes/join.rb
bmg-0.18.14 lib/bmg/sql/nodes/join.rb