Module: F4R

Defined in:
lib/f4r.rb

Defined Under Namespace

Modules: Definition, Encoder, GlobalFit Classes: CRC16, Config, Decoder, Error, F4RLogger, Logger, Record, Registry

Constant Summary collapse

VERSION =
'0.1.0'
FIT_PROFILE_REV =

Fit Profile revision for the messages and types in the Config.directory.

'2.3'
Log =

Single F4RLogger instance

F4RLogger.instance

Class Method Summary collapse

Class Method Details

.decode(file) ⇒ Object

Parameters:

  • file (String)

    path to file to be decoded.



1729
1730
1731
1732
# File 'lib/f4r.rb', line 1729

def self.decode(file)
  Log.info "Reading #{file} file."
  Decoder.decode(file)
end

.encode(file, records, source = nil) ⇒ Object

Parameters:

  • file (String)

    path for new FIT file

  • records (Hash, Registry)
  • source (String) (defaults to: nil)

    Optional source FIT file to be used as a reference for structuring the binary data.



1742
1743
1744
1745
# File 'lib/f4r.rb', line 1742

def self.encode(file, records, source = nil)
  Log.info "Writing to #{file} file."
  Encoder.encode(file, records, source)
end