Class: Wonkavision::Analytics::CellSet
- Inherits:
-
Object
- Object
- Wonkavision::Analytics::CellSet
show all
- Defined in:
- lib/wonkavision/plugins/analytics/cellset.rb
Defined Under Namespace
Classes: Axis, Cell, Dimension, Measure, Member
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(aggregation, query, tuples) ⇒ CellSet
Returns a new instance of CellSet.
8
9
10
11
12
13
14
15
16
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 8
def initialize(aggregation,query,tuples)
@axes = []
@query = query
dimension_members, @cells = process_tuples(aggregation, query, tuples)
query.axes.each do |axis_dimensions|
@axes << Axis.new(axis_dimensions,dimension_members,aggregation)
end
end
|
Instance Attribute Details
#axes ⇒ Object
Returns the value of attribute axes.
6
7
8
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 6
def axes
@axes
end
|
#query ⇒ Object
Returns the value of attribute query.
6
7
8
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 6
def query
@query
end
|
Instance Method Details
#[](*coordinates) ⇒ Object
28
29
30
31
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 28
def [](*coordinates)
key = coordinates.map{ |c|c.to_s }
@cells[key]
end
|
#chapters ⇒ Object
21
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 21
def chapters; axes[3]; end
|
#columns ⇒ Object
18
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 18
def columns; axes[0]; end
|
#inspect ⇒ Object
24
25
26
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 24
def inspect
"<Cellset #{object_id} select:#{@query.selected_dimensions} where:#{@query.slicer}>"
end
|
#length ⇒ Object
33
34
35
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 33
def length
@cells.length
end
|
#pages ⇒ Object
20
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 20
def pages; axex[2]; end
|
#rows ⇒ Object
19
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 19
def rows; axes[1]; end
|
#sections ⇒ Object
22
|
# File 'lib/wonkavision/plugins/analytics/cellset.rb', line 22
def sections; axes[4]; end
|