lib/fit4ruby/Metrics.rb
def new_fit_data_record(record_type, field_values = {})
      case record_type
      when 'file_id'
        @file_id = (record = FileId.new(field_values))
      when 'file_creator'
        @software = (record = FileCreator.new(field_values))
      when 'device_info'
        @device_infos << (record = DeviceInfo.new(field_values))
      when 'training_status'
        @training_statuses << (record = TrainingStatus.new(field_values))
      else
        record = nil
      end

      record
    end
def new_fit_data_record(record_type, field_values = {})
      case record_type
      when 'file_id'
        @file_id = (record = FileId.new(field_values))
      when 'file_creator'
        @software = (record = FileCreator.new(field_values))
      when 'device_info'
        @device_infos << (record = DeviceInfo.new(field_values))
      when 'training_status'
        @training_statuses << (record = TrainingStatus.new(field_values))
      else
        record = nil
      end

      record
    end
Create a new FitDataRecord.
 @param record_type [String] Type that identifies the FitDataRecord
        derived class to create.
 @param field_values [Hash] A Hash that provides initial values for
        certain fields of the FitDataRecord.
 @return FitDataRecord