Class: Timely::Formats::Hash
- Inherits:
-
Timely::Formatter
- Object
- Timely::Formatter
- Timely::Formats::Hash
- Defined in:
- lib/timely/formats/hash.rb
Instance Attribute Summary
Attributes inherited from Timely::Formatter
Instance Method Summary collapse
-
#output ⇒ Object
Turn a report into a simple hash keyed off of the row titles.
Methods inherited from Timely::Formatter
Constructor Details
This class inherits a constructor from Timely::Formatter
Instance Method Details
#output ⇒ Object
Turn a report into a simple hash keyed off of the row titles
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/timely/formats/hash.rb', line 5 def output {}.tap do |hash| raw = report.raw # headings hash[""] = report.columns.map(&:title) # data raw.each do |row, cells| hash[row.title] = cells.map(&:value) end end end |