Module: ActiveWarehouse::Report::AbstractReport
- Included in:
- ChartReport, TableReport
- Defined in:
- lib/active_warehouse/report/abstract_report.rb
Instance Attribute Summary collapse
-
#pass_params ⇒ Object
Returns the value of attribute pass_params.
Instance Method Summary collapse
-
#column_dimension_class ⇒ Object
Get the column dimension class.
- #column_hierarchy ⇒ Object
- #column_param_prefix ⇒ Object
-
#cube ⇒ Object
Get the current cube instance.
-
#cube_name=(name) ⇒ Object
Set the cube name.
-
#fact_attributes ⇒ Object
Get the list of displayed fact attributes.
-
#fact_class ⇒ Object
Get the fact class.
-
#row_dimension_class ⇒ Object
Get the row dimension class.
- #row_hierarchy ⇒ Object
- #row_param_prefix ⇒ Object
Instance Attribute Details
#pass_params ⇒ Object
Returns the value of attribute pass_params.
5 6 7 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 5 def pass_params @pass_params end |
Instance Method Details
#column_dimension_class ⇒ Object
Get the column dimension class
28 29 30 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 28 def column_dimension_class @column_dimension_class ||= ActiveWarehouse::Dimension.class_name(self.column_dimension_name).constantize end |
#column_hierarchy ⇒ Object
32 33 34 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 32 def column_hierarchy self['column_hierarchy'] || column_dimension_class.hierarchies.first end |
#column_param_prefix ⇒ Object
36 37 38 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 36 def column_param_prefix self['column_param_prefix'] || 'c' end |
#cube ⇒ Object
Get the current cube instance
14 15 16 17 18 19 20 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 14 def cube if @cube.nil? cube_class = ActiveWarehouse::Cube.class_name(self.cube_name).constantize @cube = cube_class.new end @cube end |
#cube_name=(name) ⇒ Object
Set the cube name
8 9 10 11 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 8 def cube_name=(name) self['cube_name'] = name @cube = nil end |
#fact_attributes ⇒ Object
Get the list of displayed fact attributes. If this value is not specified then all aggregate and calculated fields will be displayed
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 55 def fact_attributes return self['fact_attributes'] if self['fact_attributes'] fa = [] fact_class.aggregate_fields.each do |name| fa << name end fact_class.calculated_fields.each do |name| fa << name end fa end |
#fact_class ⇒ Object
Get the fact class
23 24 25 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 23 def fact_class cube.class.fact_class end |
#row_dimension_class ⇒ Object
Get the row dimension class
41 42 43 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 41 def row_dimension_class @row_dimension_class ||= ActiveWarehouse::Dimension.class_name(self.row_dimension_name).constantize end |
#row_hierarchy ⇒ Object
45 46 47 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 45 def row_hierarchy self['row_hierarchy'] || row_dimension_class.hierarchies.first end |
#row_param_prefix ⇒ Object
49 50 51 |
# File 'lib/active_warehouse/report/abstract_report.rb', line 49 def row_param_prefix self['row_param_prefix'] || 'r' end |