Sha256: a68ff6d65c9832216500f12bb79fce5608c15eedeb1f70549d26c48841b9262e

Contents?: true

Size: 459 Bytes

Versions: 3

Compression:

Stored size: 459 Bytes

Contents

module FitParser
  class File
    def self.read(io)
      new.read(io)
    end

    attr_reader :header, :records, :crc

    def initialize
      @records = []
    end

    def read(io)
      @header = Header.read(io)
      definitions = {}
      while io.pos < @header.end_pos
        record = Record.new(definitions)
        @records << record.read(io)
        definitions = record.definitions
      end
      @crc = io.read(2)
      self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
fit_parser-0.0.8 lib/fit_parser/file.rb
fit_parser-0.0.7 lib/fit_parser/file.rb
fit_parser-0.0.6 lib/fit_parser/file.rb