Top Level Namespace
Defined Under Namespace
Modules: SimpleMetarParser
Instance Method Summary collapse
-
#decode_runway(s, ) ⇒ Object
Decode runway data.
-
#valid? ⇒ Boolean
If metar string is valid, processed ok with basic data, and time was correct.
Instance Method Details
#decode_runway(s, ) ⇒ Object
Decode runway data. Not yet implemented.
30 31 32 33 34 |
# File 'lib/simple_metar_parser/tmp/tmp.rb', line 30 def decode_runway(s) # BIAR 130700Z 17003KT 0350 R01/0900V1500U +SN VV001 M04/M04 Q0996 # Runway 01, touchdown zone visual range is variable from a minimum of 0900 meters until a maximum of 1500 meters, and increasing # http://heras-gilsanz.com/manuel/METAR-Decoder.html end |
#valid? ⇒ Boolean
If metar string is valid, processed ok with basic data, and time was correct
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/simple_metar_parser/tmp/tmp.rb', line 3 def valid? if TYPE_ARCHIVED == @type if not @city_metar.nil? and not self.temperature.nil? and not self.wind.nil? and not self.time_from.nil? and self.time_from <= Time.now return true end elsif TYPE_FRESH == @type # time should be near now if not @city_metar.nil? and self.time_from <= Time.now and self.time_from >= (Time.now - 3*24*3600) return true end end return false end |