aboutsummaryrefslogtreecommitdiffstats
path: root/lib/arel/factory_methods.rb
blob: c9b6c3b791c6bab4cb8c4bd0200a9635b9289d06 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
module Arel
  ###
  # Methods for creating various nodes
  module FactoryMethods
    def create_join from, to, on = nil, klass = Nodes::InnerJoin
      klass.new(from, to, on)
    end

    def create_string_join from, to
      create_join from, to, nil, Nodes::StringJoin
    end

    def create_and clauses
      Nodes::And.new clauses
    end

    def create_on expr
      Nodes::On.new expr
    end
  end
end