Module: Fit4Ruby::BDFieldNameTranslator

Included in:
FitDataRecord, FitMessageRecord
Defined in:
lib/fit4ruby/BDFieldNameTranslator.rb

Overview

Some FIT message field names conflict with BinData reserved names. We use this translation method to map the conflicting names to BinData compatible names.

Constant Summary collapse

BD_DICT =
{
  'array' => '_array',
  'type' => '_type'
}

Instance Method Summary collapse

Instance Method Details

#to_bd_field_name(name) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/fit4ruby/BDFieldNameTranslator.rb', line 25

def to_bd_field_name(name)
  if (bd_name = BD_DICT[name])
    return bd_name
  end

  name
end