Class: Arel::Nodes::Binary

Inherits:
Node
  • Object
show all
Defined in:
lib/arel/nodes/binary.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(left, right) ⇒ Binary

Returns a new instance of Binary.



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

def initialize left, right
  super()
  @left  = left
  @right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



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

def left
  @left
end

#rightObject

Returns the value of attribute right.



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

def right
  @right
end

Instance Method Details

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

Returns:

  • (Boolean)


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

def eql? other
  self.class == other.class &&
    self.left == other.left &&
    self.right == other.right
end

#hashObject



19
20
21
# File 'lib/arel/nodes/binary.rb', line 19

def hash
  [self.class, @left, @right].hash
end

#initialize_copy(other) ⇒ Object



13
14
15
16
17
# File 'lib/arel/nodes/binary.rb', line 13

def initialize_copy other
  super
  @left  = @left.clone if @left
  @right = @right.clone if @right
end