Class: Nmea::Gps::SentenceBase
- Inherits:
-
Object
- Object
- Nmea::Gps::SentenceBase
- Defined in:
- lib/nmea_gps/sentence_base.rb
Constant Summary collapse
- STATUSES =
{ "A" => :valid, "V" => :invalid, }
- MODES =
{ "A" => :autonomous, "N" => :no_fix, "D" => :dgps, "E" => :dr, }
Instance Attribute Summary collapse
-
#raw_sentence_line ⇒ Object
readonly
Returns the value of attribute raw_sentence_line.
Instance Method Summary collapse
-
#initialize(raw_sentence_line) ⇒ SentenceBase
constructor
A new instance of SentenceBase.
- #name ⇒ Object
- #raw_data ⇒ Object
Constructor Details
#initialize(raw_sentence_line) ⇒ SentenceBase
Returns a new instance of SentenceBase.
20 21 22 |
# File 'lib/nmea_gps/sentence_base.rb', line 20 def initialize(raw_sentence_line) @raw_sentence_line = raw_sentence_line end |
Instance Attribute Details
#raw_sentence_line ⇒ Object (readonly)
Returns the value of attribute raw_sentence_line.
18 19 20 |
# File 'lib/nmea_gps/sentence_base.rb', line 18 def raw_sentence_line @raw_sentence_line end |
Instance Method Details
#name ⇒ Object
24 25 26 |
# File 'lib/nmea_gps/sentence_base.rb', line 24 def name raise "override this method" end |
#raw_data ⇒ Object
28 29 30 31 |
# File 'lib/nmea_gps/sentence_base.rb', line 28 def raw_data _, *data = self.raw_sentence_line.split("*").first.split(",") data end |