lib/fit4ruby/FitFile.rb in fit4ruby-1.2.0 vs lib/fit4ruby/FitFile.rb in fit4ruby-1.3.0
- old
+ new
@@ -142,11 +142,17 @@
crc
end
def dump_records(records)
+ # For each message number we keep a count for how often we already had
+ # this kind of message.
+ message_counters = Hash.new(0)
+
records.each do |record|
- record.dump
+ record.dump(message_counters[record.number])
+ # Increase the counter for this message number.
+ message_counters[record.number] += 1
end
end
end