Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor the rows method in the statistics block
Divides the rows method to a small public rows method and a private `row_lines` method. This allows further refactoring without having to change the tests. Use a map rather than an each in rows method to make the method slightly smaller. `each_with_index` has been replaced with `each_with_object` for the same reason. The CSV rows are being returned with symbol keys to that `to_sym` doesn't need to be used in multiple places. Finally, the row keys and values are being obfuscated. We can't guarantee what the keys will be named so it's better not to rely on them. We're still assuming that each row will have 3 columns: - x-axis value - variable / line name - y-axis value
- Loading branch information