Class: Arel::Nodes::And

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/and.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

#initialize(children) ⇒ And

Returns a new instance of And.



7
8
9
10
# File 'lib/arel/nodes/and.rb', line 7

def initialize children
  super()
  @children = children
end

Instance Attribute Details

#childrenObject (readonly)

Returns the value of attribute children.



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

def children
  @children
end

Instance Method Details

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

Returns:

  • (Boolean)


24
25
26
27
# File 'lib/arel/nodes/and.rb', line 24

def eql? other
  self.class == other.class &&
    self.children == other.children
end

#hashObject



20
21
22
# File 'lib/arel/nodes/and.rb', line 20

def hash
  children.hash
end

#leftObject



12
13
14
# File 'lib/arel/nodes/and.rb', line 12

def left
  children.first
end

#rightObject



16
17
18
# File 'lib/arel/nodes/and.rb', line 16

def right
  children[1]
end