Sha256: 9f20eab88c5088140bf228908093f310595d49662bbda5347f87fcb502cc5c2a

Contents?: true

Size: 728 Bytes

Versions: 2

Compression:

Stored size: 728 Bytes

Contents

module AIPP
  module LF

    # Designated Points
    class ENR43 < AIP

      include AIPP::LF::Helpers::Common

      def parse
        prepare(html: read).css('tbody').each do |tbody|
          tbody.css('tr').to_enum.with_index(1).each do |tr, index|
            tds = tr.css('td')
            designated_point = AIXM.designated_point(
              type: :icao,
              id: tds[0].text.strip,
              xy: xy_from(tds[1].text)
            )
            designated_point.source = source(position: tr.line)
            add designated_point
          rescue => error
            warn("error parsing designated point at ##{index}: #{error.message}", pry: error)
          end
        end
      end

    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
aipp-0.2.4 lib/aipp/regions/LF/ENR-4.3.rb
aipp-0.2.3 lib/aipp/regions/LF/ENR-4.3.rb