Module: Arel::FactoryMethods

Included in:
Nodes::Node, Table, TreeManager
Defined in:
lib/arel/factory_methods.rb

Overview

Methods for creating various nodes

Instance Method Summary (collapse)

Instance Method Details

- (Object) create_and(clauses)



25
26
27
# File 'lib/arel/factory_methods.rb', line 25

def create_and clauses
  Nodes::And.new clauses
end

- (Object) create_false



9
10
11
# File 'lib/arel/factory_methods.rb', line 9

def create_false
  Arel::Nodes::False.new
end

- (Object) create_join(to, constraint = nil, klass = Nodes::InnerJoin)



17
18
19
# File 'lib/arel/factory_methods.rb', line 17

def create_join to, constraint = nil, klass = Nodes::InnerJoin
  klass.new(to, constraint)
end

- (Object) create_on(expr)



29
30
31
# File 'lib/arel/factory_methods.rb', line 29

def create_on expr
  Nodes::On.new expr
end

- (Object) create_string_join(to)



21
22
23
# File 'lib/arel/factory_methods.rb', line 21

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

- (Object) create_table_alias(relation, name)



13
14
15
# File 'lib/arel/factory_methods.rb', line 13

def create_table_alias relation, name
  Nodes::TableAlias.new(relation, name)
end

- (Object) create_true



5
6
7
# File 'lib/arel/factory_methods.rb', line 5

def create_true
  Arel::Nodes::True.new
end

- (Object) grouping(expr)



33
34
35
# File 'lib/arel/factory_methods.rb', line 33

def grouping expr
  Nodes::Grouping.new expr
end

- (Object) lower(column)

Create a LOWER() function



39
40
41
# File 'lib/arel/factory_methods.rb', line 39

def lower column
  Nodes::NamedFunction.new 'LOWER', [Nodes.build_quoted(column)]
end