Class: Arel::Nodes::SelectCore

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/select_core.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#_caller, #and, #each, #not, #or, #to_sql

Methods included from FactoryMethods

#create_and, #create_false, #create_join, #create_on, #create_string_join, #create_table_alias, #create_true, #grouping, #lower

Constructor Details

#initializeSelectCore

Returns a new instance of SelectCore.



8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/arel/nodes/select_core.rb', line 8

def initialize
  super()
  @source         = JoinSource.new nil
  @top            = nil

  # http://savage.net.au/SQL/sql-92.bnf.html#set%20quantifier
  @set_quantifier = nil
  @projections    = []
  @wheres         = []
  @groups         = []
  @havings        = []
  @windows        = []
end

Instance Attribute Details

#groupsObject

Returns the value of attribute groups.



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

def groups
  @groups
end

#havingsObject

Returns the value of attribute havings.



6
7
8
# File 'lib/arel/nodes/select_core.rb', line 6

def havings
  @havings
end

#projectionsObject

Returns the value of attribute projections.



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

def projections
  @projections
end

#set_quantifierObject

Returns the value of attribute set_quantifier.



6
7
8
# File 'lib/arel/nodes/select_core.rb', line 6

def set_quantifier
  @set_quantifier
end

#sourceObject

Returns the value of attribute source.



6
7
8
# File 'lib/arel/nodes/select_core.rb', line 6

def source
  @source
end

#topObject

Returns the value of attribute top.



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

def top
  @top
end

#wheresObject

Returns the value of attribute wheres.



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

def wheres
  @wheres
end

#windowsObject

Returns the value of attribute windows.



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

def windows
  @windows
end

Instance Method Details

#eql?(other) ⇒ Boolean Also known as: ==

Returns:

  • (Boolean)


50
51
52
53
54
55
56
57
58
59
60
# File 'lib/arel/nodes/select_core.rb', line 50

def eql? other
  self.class == other.class &&
    self.source == other.source &&
    self.top == other.top &&
    self.set_quantifier == other.set_quantifier &&
    self.projections == other.projections &&
    self.wheres == other.wheres &&
    self.groups == other.groups &&
    self.havings == other.havings &&
    self.windows == other.windows
end

#fromObject Also known as: froms



22
23
24
# File 'lib/arel/nodes/select_core.rb', line 22

def from
  @source.left
end

#from=(value) ⇒ Object Also known as: froms=



26
27
28
# File 'lib/arel/nodes/select_core.rb', line 26

def from= value
  @source.left = value
end

#hashObject



43
44
45
46
47
48
# File 'lib/arel/nodes/select_core.rb', line 43

def hash
  [
    @source, @top, @set_quantifier, @projections,
    @wheres, @groups, @havings, @windows
  ].hash
end

#initialize_copy(other) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/arel/nodes/select_core.rb', line 33

def initialize_copy other
  super
  @source      = @source.clone if @source
  @projections = @projections.clone
  @wheres      = @wheres.clone
  @groups      = @groups.clone
  @havings     = @havings.clone
  @windows     = @windows.clone
end