Sha256: 4b63eca92bb0b86cdad26eef3a8289dc23e8ee0a327434af52ce22ca3237e69a
Contents?: true
Size: 850 Bytes
Versions: 17
Compression:
Stored size: 850 Bytes
Contents
#!/usr/bin/env ruby -w # encoding: UTF-8 # # = FitRecordHeader.rb -- Fit4Ruby - FIT file processing library for Ruby # # Copyright (c) 2014, 2017 by Chris Schlaeger <cs@taskjuggler.org> # # This program is free software; you can redistribute it and/or modify # it under the terms of version 2 of the GNU General Public License as # published by the Free Software Foundation. # module Fit4Ruby class FitRecordHeader < BinData::Record bit1 :normal bit1 :message_type, :onlyif => :normal? bit1 :developer_data_flag, :onlyif => :normal? bit1 :reserved, :onlyif => :normal? choice :local_message_type, :selection => :normal do bit4 0 bit2 1 end bit5 :time_offset, :onlyif => :compressed? def normal? normal.snapshot == 0 end def compressed? normal.snapshot == 1 end end end
Version data entries
17 entries across 17 versions & 1 rubygems