lib/fit_parser/file.rb in fit_parser-0.0.5 vs lib/fit_parser/file.rb in fit_parser-0.0.6
- old
+ new
@@ -1,8 +1,7 @@
module FitParser
class File
-
def self.read(io)
new.read(io)
end
attr_reader :header, :records, :crc
@@ -11,19 +10,16 @@
@records = []
end
def read(io)
@header = Header.read(io)
-
- Record.clear_definitions!
-
+ definitions = {}
while io.pos < @header.end_pos
- @records << Record.read(io)
+ record = Record.new(definitions)
+ @records << record.read(io)
+ definitions = record.definitions
end
-
@crc = io.read(2)
-
self
end
-
end
end