Class: OlapResult
- Inherits:
-
Object
- Object
- OlapResult
- Defined in:
- lib/cube/olap_result.rb
Instance Attribute Summary collapse
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#rows ⇒ Object
readonly
Returns the value of attribute rows.
Instance Method Summary collapse
-
#initialize(table) ⇒ OlapResult
constructor
A new instance of OlapResult.
- #prepare_data ⇒ Object
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
#header ⇒ Object (readonly)
Returns the value of attribute header.
2 3 4 |
# File 'lib/cube/olap_result.rb', line 2 def header @header end |
#rows ⇒ Object (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_data ⇒ Object
9 10 11 12 |
# File 'lib/cube/olap_result.rb', line 9 def prepare_data result = [] << [@header] << @rows result.flatten(1) end |