Class: Influxdb::Arel::Nodes::Binary

Inherits:
Node show all
Defined in:
lib/influxdb/arel/nodes/binary.rb

Direct Known Subclasses

Duration, Equality, InfixOperation, Merge, TableAlias

Constant Summary

Constants inherited from Node

Node::ENTENSIONS

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#extend, #to_sql

Methods included from Extensions::BooleanPredications

#and, #or

Constructor Details

#initialize(left, right) ⇒ Binary

Returns a new instance of Binary.



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

def initialize(left, right)
  super()
  left = left.to_s if Symbol === left
  right = right.to_s if Symbol === right
  self.left = left
  self.right = right
end

Instance Attribute Details

#leftObject

Returns the value of attribute left.



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

def left
  @left
end

#rightObject

Returns the value of attribute right.



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

def right
  @right
end

Instance Method Details

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

Returns:

  • (Boolean)


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

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

#hashObject



21
22
23
# File 'lib/influxdb/arel/nodes/binary.rb', line 21

def hash
  [left, right].hash
end

#initialize_copy(other) ⇒ Object



15
16
17
18
19
# File 'lib/influxdb/arel/nodes/binary.rb', line 15

def initialize_copy(other)
  super
  self.left = left.safe_clone if left
  self.right = right.safe_clone if right
end