Class: AIPP::LF::ENR41
- Includes:
- Helpers::Common
- Defined in:
- lib/aipp/regions/LF/ENR-4.1.rb
Overview
ENR Navaids
Constant Summary
Constants included from Helpers::Common
Helpers::Common::ANGLICISE_MAP, Helpers::Common::BORDERS, Helpers::Common::INTERSECTIONS, Helpers::Common::SURFACES
Constants inherited from AIP
Instance Attribute Summary
Attributes inherited from AIP
Instance Method Summary collapse
Methods included from Helpers::Common
#anglicise, #elevation_from, #geometry_from, #layer_from, #organisation_lf, #prepare, #source, #timetable_from!, #xy_from
Methods inherited from AIP
#add, #borders, #cache, #close, #config, #initialize, #options, #read, #select
Methods included from Patcher
#attach_patches, #detach_patches
Constructor Details
This class inherits a constructor from AIPP::AIP
Instance Method Details
#parse ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/aipp/regions/LF/ENR-4.1.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') master, slave = tds[1].text.strip.gsub(/[^\w-]/, '').downcase.split('-') navaid = AIXM.send(master, base_from(tds).merge(send("#{master}_from", tds))) navaid.source = source(position: tr.line) navaid. = tds[4].text navaid.remarks = remarks_from(tds[5], tds[7], tds[9]) navaid.send("associate_#{slave}", channel: channel_from(tds[3].text)) if slave add navaid rescue => error warn("error parsing navigational aid at ##{index}: #{error.}", pry: error) end end end |