Class: Influxdb::Arel::Nodes::Unary

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

Direct Known Subclasses

Attribute, Grouping, Ordering, Table, Time

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(expr) ⇒ Unary

Returns a new instance of Unary.



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

def initialize(expr)
  super()
  expr = expr.to_s if Symbol === expr
  self.expr = expr
end

Instance Attribute Details

#exprObject Also known as: value

Returns the value of attribute expr.



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

def expr
  @expr
end

Instance Method Details

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

Returns:

  • (Boolean)


23
24
25
# File 'lib/influxdb/arel/nodes/unary.rb', line 23

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

#hashObject



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

def hash
  self.expr.hash
end

#initialize_copy(other) ⇒ Object



14
15
16
17
# File 'lib/influxdb/arel/nodes/unary.rb', line 14

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