Class: XMLA::Cube

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#catalogObject (readonly)

Returns the value of attribute catalog.



16
17
18
# File 'lib/cube/cube.rb', line 16

def catalog
  @catalog
end

#queryObject (readonly)

Returns the value of attribute query.



16
17
18
# File 'lib/cube/cube.rb', line 16

def query
  @query
end

Class Method Details

.execute(query, catalog = XMLA.catalog) ⇒ Object



18
19
20
# File 'lib/cube/cube.rb', line 18

def Cube.execute(query, catalog = XMLA.catalog)
  OlapResult.new(Cube.new(query, catalog).as_table)
end

.execute_scalar(query, catalog = XMLA.catalog) ⇒ Object



22
23
24
# File 'lib/cube/cube.rb', line 22

def Cube.execute_scalar(query, catalog = XMLA.catalog)
  BigDecimal.new Cube.new(query, catalog).as_table[0]
end

Instance Method Details

#as_tableObject



26
27
28
29
# File 'lib/cube/cube.rb', line 26

def as_table 
  return [table] if y_size == 0
  clean_table(table, y_size).reduce([]) { |result, row| result << row.flatten }
end