Class: AIPP::LF::ENR43

Inherits:
AIP show all
Includes:
Helpers::Base
Defined in:
lib/aipp/regions/LF/ENR-4.3.rb

Overview

Designated Points

Constant Summary

Constants included from Helpers::Base

Helpers::Base::ANGLICISE_MAP, Helpers::Base::BORDERS, Helpers::Base::INTERSECTIONS, Helpers::Base::SURFACES

Constants inherited from AIP

AIP::DEPENDS

Instance Attribute Summary

Attributes inherited from AIP

#aip, #fixture

Instance Method Summary collapse

Methods included from Helpers::Base

#anglicise, #d_from, #elevation_from, #geometry_from, #layer_from, #organisation_lf, #prepare, #source, #timetable_from!, #xy_from, #z_from

Methods inherited from AIP

#add, #borders, #cache, #close, #config, #find, #find_by, #initialize, #options, #read

Methods included from Patcher

#attach_patches, #detach_patches, included

Constructor Details

This class inherits a constructor from AIPP::AIP

Instance Method Details

#parseObject


9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/aipp/regions/LF/ENR-4.3.rb', line 9

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')
      add AIXM.designated_point(
        source: source(position: tr.line),
        type: :icao,
        id: tds[0].text.strip,
        xy: xy_from(tds[1].text)
      )
    rescue => error
      warn("error parsing designated point at ##{index}: #{error.message}", pry: error)
    end
  end
end