Method: NMEAPlus::NMEAMessageFactory.alternate_data_type
- Defined in:
- lib/nmea_plus/nmea_message_factory.rb
.alternate_data_type(data_type) ⇒ Array
Match all NMEA messages as their generic counterparts. GPGLL becomes GLL, etc.
186 187 188 189 190 191 192 193 194 |
# File 'lib/nmea_plus/nmea_message_factory.rb', line 186 def self.alternate_data_type(data_type) # match last 3 digits (get rid of talker) sentence_type = data_type[2..4] alternates = [sentence_type] # Match special Route messages: R00 is the same as R01, R02... alternates.push('R00') unless /R\d\d/.match(sentence_type).nil? alternates end |