class AIPP::AIP
@abstract
Constants
- DEPENDS
Attributes
aip[R]
@return [String] AIP
name (e.g. “ENR-2.1”)
fixture[R]
@return [Object] Fixture read from YAML file
Public Class Methods
new(aip:, downloader:, fixture:, parser:)
click to toggle source
# File lib/aipp/aip.rb 31 def initialize(aip:, downloader:, fixture:, parser:) 32 @aip, @downloader, @fixture, @parser = aip, downloader, fixture, parser 33 self.class.include ("AIPP::%s::Helpers::URL" % options[:region]).constantize 34 end
Public Instance Methods
add(feature)
click to toggle source
Add feature to AIXM
@param feature [AIXM::Feature] e.g. airport or airspace @return [AIXM::Feature] added feature
# File lib/aipp/aip.rb 56 def add(feature) 57 verbose_info "Adding #{feature.inspect}" 58 aixm.add_feature feature 59 feature 60 end
read(aip_file=nil)
click to toggle source
Read an AIP
source file
Read the cached source file if it exists in the source archive. Otherwise, download it from URL and cache it.
An URL builder method +url_for(aip_file)+ must be defined either in helper.rb
or in the AIP
parser definition (e.g. ENR-2.1.rb
).
@param aip_file [String] e.g. “ENR-2.1” or “AD-2.LFMV” (default: aip
) @return [Nokogiri::HTML5::Document, String] HTML as Nokogiri document,
PDF or TXT as String
# File lib/aipp/aip.rb 47 def read(aip_file=nil) 48 aip_file ||= aip 49 @downloader.read(document: aip_file, url: url_for(aip_file)) 50 end