Class: InfluxDB2::FluxTable

Inherits:
Object
  • Object
show all
Defined in:
lib/influxdb2/client/flux_table.rb

Overview

This class represents the table structure of the Flux CSV Response. Ref: bit.ly/flux-spec#table

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeFluxTable

Returns a new instance of FluxTable.



25
26
27
28
# File 'lib/influxdb2/client/flux_table.rb', line 25

def initialize
  @columns = []
  @records = []
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



30
31
32
# File 'lib/influxdb2/client/flux_table.rb', line 30

def columns
  @columns
end

#recordsObject (readonly)

Returns the value of attribute records.



30
31
32
# File 'lib/influxdb2/client/flux_table.rb', line 30

def records
  @records
end

Instance Method Details

#group_keyObject

A table's group key is subset of the entire columns dataset that assigned to the table. As such, all records within a table will have the same values for each column that is part of the group key.



34
35
36
37
38
39
40
41
42
# File 'lib/influxdb2/client/flux_table.rb', line 34

def group_key
  columns = []

  @columns.each do |column|
    columns.push(column) if column.group
  end

  columns
end