Module: ActiveWarehouse::Report::AbstractReport

Included in:
ChartReport, TableReport
Defined in:
lib/active_warehouse/report/abstract_report.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#pass_paramsObject

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_classObject

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_hierarchyObject



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_prefixObject



36
37
38
# File 'lib/active_warehouse/report/abstract_report.rb', line 36

def column_param_prefix
  self['column_param_prefix'] || 'c'
end

#cubeObject

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_attributesObject

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_classObject

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_classObject

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_hierarchyObject



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_prefixObject



49
50
51
# File 'lib/active_warehouse/report/abstract_report.rb', line 49

def row_param_prefix
  self['row_param_prefix'] || 'r'
end