aboutsummaryrefslogtreecommitdiffstats
path: root/parse_report.rb
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2014-11-14 16:14:03 +0100
committerHarald Eilertsen <haraldei@anduin.net>2014-11-14 16:16:22 +0100
commit057bed03018c3235fbcd3c21abd86f02f65f96c1 (patch)
treef6b77a9e86fb7e920f884f9f4de595c3839d9415 /parse_report.rb
parentc4bc044881c05822a66d4f77a4ffad9368235731 (diff)
downloadimusician-reports-057bed03018c3235fbcd3c21abd86f02f65f96c1.tar.gz
imusician-reports-057bed03018c3235fbcd3c21abd86f02f65f96c1.tar.bz2
imusician-reports-057bed03018c3235fbcd3c21abd86f02f65f96c1.zip
Reports pick up their data from the row rather than the sale object.
Diffstat (limited to 'parse_report.rb')
-rw-r--r--parse_report.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/parse_report.rb b/parse_report.rb
index 48b7c71..7af1a82 100644
--- a/parse_report.rb
+++ b/parse_report.rb
@@ -28,11 +28,11 @@ end
reports = load_reports
-sales = []
parse_csv(ARGV[0]) do |row|
- sales << SalesReporter::Sale.new(row["Date"], row["revenue EUR"], row["quantity"], row["Country"], row["Shop"])
+ sale = SalesReporter::Sale.new(row["Date"], row["revenue EUR"], row["quantity"])
+ reports.each { |r| r.add_sale(sale, row) }
end
reports.each do |report|
- report.render(sales)
+ report.render
end