Class: FileHeader
Constant Summary
Constants included from Unpack
Instance Attribute Summary collapse
-
#crc ⇒ Object
Returns the value of attribute crc.
-
#header_size ⇒ Object
Returns the value of attribute header_size.
-
#num_record_bytes ⇒ Object
Returns the value of attribute num_record_bytes.
-
#profile_version ⇒ Object
Returns the value of attribute profile_version.
-
#protocol_version ⇒ Object
Returns the value of attribute protocol_version.
-
#valid_file ⇒ Object
Returns the value of attribute valid_file.
Instance Method Summary collapse
-
#initialize(io) ⇒ FileHeader
constructor
A new instance of FileHeader.
Methods inherited from FitObject
Methods included from Unpack
#read_bit, #read_bits, #read_multiple, #readbytes
Constructor Details
#initialize(io) ⇒ FileHeader
Returns a new instance of FileHeader.
4 5 6 7 8 9 10 11 |
# File 'lib/fitreader/file_header.rb', line 4 def initialize(io) @header_size = io.readbyte @protocol_version = io.readbyte @profile_version = readbytes(io, 'v', 2) @num_record_bytes = readbytes(io, 'V', 4) @valid_file = io.read(4) == '.FIT' @crc = readbytes(io, 'v', 2) end |
Instance Attribute Details
#crc ⇒ Object
Returns the value of attribute crc.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def crc @crc end |
#header_size ⇒ Object
Returns the value of attribute header_size.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def header_size @header_size end |
#num_record_bytes ⇒ Object
Returns the value of attribute num_record_bytes.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def num_record_bytes @num_record_bytes end |
#profile_version ⇒ Object
Returns the value of attribute profile_version.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def profile_version @profile_version end |
#protocol_version ⇒ Object
Returns the value of attribute protocol_version.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def protocol_version @protocol_version end |
#valid_file ⇒ Object
Returns the value of attribute valid_file.
2 3 4 |
# File 'lib/fitreader/file_header.rb', line 2 def valid_file @valid_file end |