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.



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

def catalog
  @catalog
end

#queryObject (readonly)

Returns the value of attribute query.



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

def query
  @query
end

Class Method Details

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



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

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

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



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

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

Instance Method Details

#as_tableObject



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

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