lib/differential/calculator/report.rb in differential-1.0.4 vs lib/differential/calculator/report.rb in differential-1.0.5
- old
+ new
@@ -16,9 +16,13 @@
# - Feed in Record objects, generated by a Reader, by calling Report#add.
# The Report object will keep running sums and deltas of all added records.
class Report
include HasTotals
+ def sorted_groups
+ groups.sort_by { |group| group.id.value }
+ end
+
def groups
groups_by_id.values
end
def add(record, side)