class SimpleMetarParser::Runway

Attributes

runways[R]

Public Instance Methods

decode_split(s) click to toggle source
# 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() click to toggle source
# File lib/simple_metar_parser/metar/runway.rb, line 6
def reset
  @runways = Array.new
end