Module: Fit::File::Definitions

Defined in:
lib/fit/file/definitions.rb

Constant Summary collapse

@@fields =
Hash.new{ |h,k| h[k]= {} }
@@names =
Hash.new

Class Method Summary collapse

Class Method Details

.add_field(global_msg_num, field_def_num, name, options = {}) ⇒ Object



9
10
11
# File 'lib/fit/file/definitions.rb', line 9

def add_field(global_msg_num, field_def_num, name, options = {})
  @@fields[global_msg_num][field_def_num] = options.merge(:name => name)
end

.add_name(global_msg_num, name) ⇒ Object



17
18
19
# File 'lib/fit/file/definitions.rb', line 17

def add_name(global_msg_num, name)
  @@names[global_msg_num] = name
end

.get_field(global_msg_num, field_def_num) ⇒ Object



13
14
15
# File 'lib/fit/file/definitions.rb', line 13

def get_field(global_msg_num, field_def_num)
  @@fields[global_msg_num][field_def_num]
end

.get_name(global_msg_num) ⇒ Object



21
22
23
# File 'lib/fit/file/definitions.rb', line 21

def get_name(global_msg_num)
  @@names[global_msg_num]
end