Method: NMEAPlus::SourceDecoder#each_message
- Defined in:
- lib/nmea_plus.rb
#each_message {|NMEAPlus::Message| ... } ⇒ void
This method returns an undefined value.
Executes the block for every valid NMEA message in the source stream. In practice, you should use #each_complete_message unless you have a very compelling reason not to.
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
# File 'lib/nmea_plus.rb', line 45 def @source.each_line do |line| if @throw_on_parse_fail yield @decoder.parse(line) else got_error = false begin y = @decoder.parse(line) rescue got_error = true end yield y unless got_error end end end |