Class: Influxdb::Arel::Nodes::SelectStatement

Inherits:
Node
  • Object
show all
Defined in:
lib/influxdb/arel/nodes/select_statement.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#and, #or, #to_sql

Constructor Details

#initializeSelectStatement

Returns a new instance of SelectStatement.



7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/influxdb/arel/nodes/select_statement.rb', line 7

def initialize
  super
  self.wheres = []
  self.groups = []
  self.columns = []
  self.series = []
  self.merge = nil
  self.join = nil
  self.order = nil
  self.limit = nil
  self.fill = nil
  self.into = nil
end

Instance Attribute Details

#columnsObject

Returns the value of attribute columns.



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

def columns
  @columns
end

#fillObject

Returns the value of attribute fill.



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

def fill
  @fill
end

#groupsObject

Returns the value of attribute groups.



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

def groups
  @groups
end

#intoObject

Returns the value of attribute into.



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

def into
  @into
end

#joinObject

Returns the value of attribute join.



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

def join
  @join
end

#limitObject

Returns the value of attribute limit.



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

def limit
  @limit
end

#mergeObject

Returns the value of attribute merge.



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

def merge
  @merge
end

#orderObject

Returns the value of attribute order.



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

def order
  @order
end

#seriesObject

Returns the value of attribute series.



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

def series
  @series
end

#wheresObject

Returns the value of attribute wheres.



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

def wheres
  @wheres
end

Instance Method Details

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

Returns:

  • (Boolean)


43
44
45
46
47
48
49
50
51
52
53
# File 'lib/influxdb/arel/nodes/select_statement.rb', line 43

def eql?(other)
  self.class == other.class &&
    columns == other.columns &&
    wheres == other.wheres &&
    groups == other.groups &&
    table == other.table &&
    order == other.order &&
    limit == other.limit &&
    fill == other.fill &&
    into == other.into
end

#hashObject



39
40
41
# File 'lib/influxdb/arel/nodes/select_statement.rb', line 39

def hash
  [limit, order, wheres, groups, columns, table, fill, into].hash
end

#initialize_copy(other) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/influxdb/arel/nodes/select_statement.rb', line 21

def initialize_copy(other)
  super
  self.wheres = wheres.map{|where| where.clone }
  self.groups = groups.map{|group| group.clone }
  self.columns = columns.map{|column| column.clone }
  self.series = series.map{|series| series.clone }
  self.join = join.clone if join
  self.merge = merge.clone if merge
  self.order = order.clone if order
  self.limit = limit.clone if limit
  self.fill = fill.clone if fill
  self.into = into.clone if into
end

#tableObject



35
36
37
# File 'lib/influxdb/arel/nodes/select_statement.rb', line 35

def table
  join || merge || series.map(&:unalias).uniq
end