Class: OlapResult

Inherits:
Object
  • Object
show all
Defined in:
lib/cube/olap_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(table) ⇒ OlapResult

Returns a new instance of OlapResult.



3
4
5
6
7
# File 'lib/cube/olap_result.rb', line 3

def initialize(table)
  @header = table[0]
  table.delete_at(0)
  @rows = table
end

Instance Attribute Details

#headerObject (readonly)

Returns the value of attribute header.



2
3
4
# File 'lib/cube/olap_result.rb', line 2

def header
  @header
end

#rowsObject (readonly)

Returns the value of attribute rows.



2
3
4
# File 'lib/cube/olap_result.rb', line 2

def rows
  @rows
end

Instance Method Details

#prepare_dataObject



9
10
11
12
# File 'lib/cube/olap_result.rb', line 9

def prepare_data
  result = [] << [@header] << @rows
  result.flatten(1)
end