Class: XMLA::Cube
- Inherits:
-
Object
- Object
- XMLA::Cube
- Defined in:
- lib/cube/cube.rb
Instance Attribute Summary collapse
-
#catalog ⇒ Object
readonly
Returns the value of attribute catalog.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
Class Method Summary collapse
- .execute(query, catalog = XMLA.catalog) ⇒ Object
- .execute_scalar(query, catalog = XMLA.catalog) ⇒ Object
Instance Method Summary collapse
Instance Attribute Details
#catalog ⇒ Object (readonly)
Returns the value of attribute catalog.
15 16 17 |
# File 'lib/cube/cube.rb', line 15 def catalog @catalog end |
#query ⇒ Object (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_table ⇒ Object
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 |