class NMEAPlus::NMEAMessageFactory
Defines a factory for NMEA messages, which will all use {NMEAPlus::Message::NMEA::NMEAMessage} as their base. The factory extracts the NMEA data type (prefixed by a 2-character “talker ID”), and looks for a class with that name within the NMEA message namespace.
Public Class Methods
Source
# File lib/nmea_plus/nmea_message_factory.rb, line 185 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
Match all NMEA messages as their generic counterparts. GPGLL becomes GLL, etc. @param data_type [String] The data_type of the NMEA message (e.g. the GPGLL of “$GPGLL,12,3,,4,5*00”) @return [Array] Array of data_type strings that we will attempt to use in decoding the message
Source
# File lib/nmea_plus/nmea_message_factory.rb, line 178 def self.parent_module "NMEA" end
@return [String] The name of the parent module: NMEA