module AIPP::LF::Helpers::URL

Public Instance Methods

url_for(aip_file) click to toggle source

@param aip_file [String] e.g. ENR-5.1, AD-2.LFMV or VAC-LFMV

   # File lib/aipp/regions/LF/helpers/URL.rb
 7 def url_for(aip_file)
 8   case aip_file
 9   when /^VAC\-(\w+)/
10     "https://www.sia.aviation-civile.gouv.fr/dvd/eAIP_%s/Atlas-VAC/PDF_AIPparSSection/VAC/AD/AD-2.%s.pdf" % [
11       options[:airac].date.strftime('%d_%^b_%Y'),   # 04_JAN_2018
12       $1
13     ]
14   else
15     "https://www.sia.aviation-civile.gouv.fr/dvd/eAIP_%s/FRANCE/AIRAC-%s/html/eAIP/FR-%s-fr-FR.html" % [
16       options[:airac].date.strftime('%d_%^b_%Y'),   # 04_JAN_2018
17       options[:airac].date.xmlschema,               # 2018-01-04
18       aip_file
19     ]
20   end
21 end