Class: Fit4Ruby::FitDefinition
- Inherits:
-
BinData::Record
- Object
- BinData::Record
- Fit4Ruby::FitDefinition
- Defined in:
- lib/fit4ruby/FitDefinition.rb
Overview
The FitDefinition contains the blueprints for FitMessageRecord segments of FIT files. Before a message record can occur in a FIT file, its definition must be included in the FIT file. The definition holds enough information about the message record to define its size. It also contains some basic information how to interpret the data in the record. To fully understand the message record data the full definition in the GlobalFitMessage is required.
Instance Method Summary collapse
Instance Method Details
#check ⇒ Object
42 43 44 45 46 47 |
# File 'lib/fit4ruby/FitDefinition.rb', line 42 def check if architecture.snapshot > 1 Log.fatal "Illegal architecture value #{architecture.snapshot}" end fields.each { |f| f.check } end |
#endian ⇒ Object
38 39 40 |
# File 'lib/fit4ruby/FitDefinition.rb', line 38 def endian architecture.snapshot == 0 ? :little : :big end |
#setup(fit_message_definition) ⇒ Object
49 50 51 52 53 54 55 56 57 58 |
# File 'lib/fit4ruby/FitDefinition.rb', line 49 def setup() .fields_by_number.each do |number, f| fdf = FitDefinitionField.new fdf.field_definition_number = number fdf.set_type(f.type) fields << fdf end self.field_count = fields.length end |