123456789_123456789_123456789_123456789_123456789_

Class: Arel::Nodes::SelectCore

Do not use. This class is for internal use only.
Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
self, Node
Instance Chain:
Inherits: Arel::Nodes::Node
Defined in: activerecord/lib/arel/nodes/select_core.rb

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Node - Inherited

#and

Factory method to create an And node.

#fetch_attribute, #invert,
#not

Factory method to create a Nodes::Not node that has the recipient of the caller as a child.

#or

Factory method to create a Grouping node that has an Or node as a child.

#to_sql

FIXME: this method should go away.

::Arel::FactoryMethods - Included

Constructor Details

.new(relation = nil) ⇒ SelectCore

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 9

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

  # https://ronsavage.github.io/SQL/sql-92.bnf.html#set%20quantifier
  @set_quantifier  = nil
  @optimizer_hints = nil
  @projections     = []
  @wheres          = []
  @groups          = []
  @havings         = []
  @windows         = []
  @comment         = nil
end

Instance Attribute Details

#comment (rw)

[ GitHub ]

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

attr_accessor :projections, :wheres, :groups, :windows, :comment

#from (rw) Also known as: #froms

[ GitHub ]

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

def from
  @source.left
end

#from=(value) (rw) Also known as: #froms=

[ GitHub ]

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

def from=(value)
  @source.left = value
end

#froms (rw)

Alias for #from.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 33

alias :froms :from

#groups (rw)

[ GitHub ]

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

attr_accessor :projections, :wheres, :groups, :windows, :comment

#havings (rw)

[ GitHub ]

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

attr_accessor :havings, :source, :set_quantifier, :optimizer_hints

#optimizer_hints (rw)

[ GitHub ]

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

attr_accessor :havings, :source, :set_quantifier, :optimizer_hints

#projections (rw)

[ GitHub ]

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

attr_accessor :projections, :wheres, :groups, :windows, :comment

#set_quantifier (rw)

[ GitHub ]

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

attr_accessor :havings, :source, :set_quantifier, :optimizer_hints

#source (rw)

[ GitHub ]

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

attr_accessor :havings, :source, :set_quantifier, :optimizer_hints

#wheres (rw)

[ GitHub ]

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

attr_accessor :projections, :wheres, :groups, :windows, :comment

#windows (rw)

[ GitHub ]

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

attr_accessor :projections, :wheres, :groups, :windows, :comment

Instance Method Details

#==(other)

Alias for #eql?.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 64

alias :== :eql?

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

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 52

def eql?(other)
  self.class == other.class &&
    self.source == other.source &&
    self.set_quantifier == other.set_quantifier &&
    self.optimizer_hints == other.optimizer_hints &&
    self.projections == other.projections &&
    self.wheres == other.wheres &&
    self.groups == other.groups &&
    self.havings == other.havings &&
    self.windows == other.windows &&
    self.comment == other.comment
end

#hash

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 45

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

#initialize_copy(other)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/select_core.rb', line 35

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