Class: ReportsKit::Reports::Data::Generate
- Inherits:
-
Object
- Object
- ReportsKit::Reports::Data::Generate
- Defined in:
- lib/reports_kit/reports/data/generate.rb
Constant Summary collapse
- ROUND_PRECISION =
3
Instance Attribute Summary collapse
-
#context_record ⇒ Object
Returns the value of attribute context_record.
-
#properties ⇒ Object
Returns the value of attribute properties.
Instance Method Summary collapse
-
#initialize(properties, context_record: nil) ⇒ Generate
constructor
A new instance of Generate.
- #perform ⇒ Object
Constructor Details
#initialize(properties, context_record: nil) ⇒ Generate
Returns a new instance of Generate.
9 10 11 12 |
# File 'lib/reports_kit/reports/data/generate.rb', line 9 def initialize(properties, context_record: nil) self.properties = properties.deep_symbolize_keys self.context_record = context_record end |
Instance Attribute Details
#context_record ⇒ Object
Returns the value of attribute context_record.
7 8 9 |
# File 'lib/reports_kit/reports/data/generate.rb', line 7 def context_record @context_record end |
#properties ⇒ Object
Returns the value of attribute properties.
7 8 9 |
# File 'lib/reports_kit/reports/data/generate.rb', line 7 def properties @properties end |
Instance Method Details
#perform ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/reports_kit/reports/data/generate.rb', line 14 def perform if second_dimension data = Data::TwoDimensions.new(measure, dimension, second_dimension).perform else data = Data::OneDimension.new(measure, dimension).perform end ChartOptions.new(data, options: properties[:chart], inferred_options: ).perform end |