123456789_123456789_123456789_123456789_123456789_

Class: Arel::Nodes::Fragments

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/fragments.rb

Class Method Summary

Instance Attribute Summary

Node - Inherited

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(values = []) ⇒ Fragments

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/fragments.rb', line 8

def initialize(values = [])
  super()
  @values = values
end

Instance Attribute Details

#values (readonly)

[ GitHub ]

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

attr_reader :values

Instance Method Details

#+(other)

Raises:

  • (ArgumentError)
[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/fragments.rb', line 22

def +(other)
  raise ArgumentError, "Expected Arel node" unless Arel.arel_node?(other)

  self.class.new([*@values, other])
end

#==(other)

Alias for #eql?.

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/fragments.rb', line 32

alias :== :eql?

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

[ GitHub ]

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

def eql?(other)
  self.class == other.class &&
    self.values == other.values
end

#hash

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/fragments.rb', line 18

def hash
  [@values].hash
end

#initialize_copy(other)

[ GitHub ]

  
# File 'activerecord/lib/arel/nodes/fragments.rb', line 13

def initialize_copy(other)
  super
  @values = @values.clone
end