Class: Reportinator::PresetReport
- Inherits:
-
ReportType
- Object
- Base
- ReportType
- Reportinator::PresetReport
- Defined in:
- lib/reportinator/types/preset.rb
Constant Summary
Constants inherited from ReportType
Instance Attribute Summary
Attributes inherited from ReportType
Instance Method Summary collapse
Methods inherited from ReportType
#error_message, generate, #generate_csv, generate_to_csv, #report_title
Methods inherited from Base
config, #config, logger, #logger
Methods included from Helpers
#merge_hash, #merge_hash!, #symbolize_attributes
Instance Method Details
#data ⇒ Object
5 6 7 |
# File 'lib/reportinator/types/preset.rb', line 5 def data split_values.map { |row| Row.create(row) } end |
#split_values ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/reportinator/types/preset.rb', line 9 def split_values data = values.instance_of?(Array) ? values : [values] rows = [] temp = [] data.each do |col| if col.instance_of?(Array) rows << temp unless temp.empty? temp = [] rows << col else temp << col end end rows << temp unless temp.empty? rows end |