Module: Fifa

Defined in:
lib/fifa.rb,
lib/fifa/version.rb,
lib/fifa/org_index.rb,
lib/fifa/country_index.rb,
lib/fifa/country_reader.rb,
lib/fifa/outline_reader.rb

Defined Under Namespace

Classes: CountryIndex, CountryReader, OutlineReader

Constant Summary collapse

MAJOR =

todo: namespace inside version or something - why? why not??

2024
MINOR =
9
PATCH =
22
VERSION =
[MAJOR,MINOR,PATCH].join('.')

Class Method Summary collapse

Class Method Details

.[](q) ⇒ Object

search service (using world - note: NOT scoped/limted to members only)



35
# File 'lib/fifa.rb', line 35

def self.[]( q )   world[ q ]; end


12
13
14
# File 'lib/fifa/version.rb', line 12

def self.banner
  "fifa/#{VERSION} on Ruby #{RUBY_VERSION} (#{RUBY_RELEASE_DATE}) [#{RUBY_PLATFORM}] in (#{root})"
end

.countriesObject

note: only returns fifa member countries (use world.countries for all) !!!



32
# File 'lib/fifa.rb', line 32

def self.countries() world.members( :fifa ); end

.data_dirObject

rename to config_dir - why? why not?



20
21
22
# File 'lib/fifa/version.rb', line 20

def self.data_dir  ## rename to config_dir - why? why not?
  "#{root}/config"
end

.members(key = :fifa) ⇒ Object



36
# File 'lib/fifa.rb', line 36

def self.members( key=:fifa ) world.members( key ); end

.rootObject



16
17
18
# File 'lib/fifa/version.rb', line 16

def self.root
  File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )
end

.versionObject



8
9
10
# File 'lib/fifa/version.rb', line 8

def self.version
  VERSION
end

.worldObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/fifa.rb', line 17

def self.world
    @world ||=  CountryIndex.read(
                      "#{Fifa.data_dir}/africa/countries.txt",
                      "#{Fifa.data_dir}/asia/countries.txt",
                      "#{Fifa.data_dir}/caribbean/countries.txt",
                      "#{Fifa.data_dir}/central-america/countries.txt",
                      "#{Fifa.data_dir}/europe/countries.txt",
                      "#{Fifa.data_dir}/middle-east/countries.txt",
                      "#{Fifa.data_dir}/north-america/countries.txt",
                      "#{Fifa.data_dir}/pacific/countries.txt",
                      "#{Fifa.data_dir}/south-america/countries.txt",
                      "#{Fifa.data_dir}/countries_history.txt" )
end