Class: SimpleMetarParser::Runway
- Defined in:
- lib/simple_metar_parser/metar/runway.rb
Instance Attribute Summary collapse
-
#runways ⇒ Object
readonly
Returns the value of attribute runways.
Attributes inherited from Base
Instance Method Summary collapse
Methods inherited from Base
Constructor Details
This class inherits a constructor from SimpleMetarParser::Base
Instance Attribute Details
#runways ⇒ Object (readonly)
Returns the value of attribute runways.
10 11 12 |
# File 'lib/simple_metar_parser/metar/runway.rb', line 10 def runways @runways end |
Instance Method Details
#decode_split(s) ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/simple_metar_parser/metar/runway.rb', line 12 def decode_split(s) # TODO add variable vis. http://stoivane.iki.fi/metar/ if s =~ /R(.{2})\/P(\d{4})(.)/ h = { :runway => $1, :visual_range => $2.to_i } if $3 == "N" elsif $3 == "U" h[:change] = :up elsif $3 == "D" h[:change] = :down end @runways << h end end |
#reset ⇒ Object
6 7 8 |
# File 'lib/simple_metar_parser/metar/runway.rb', line 6 def reset @runways = Array.new end |