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 =
10
PATCH =
17
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)



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

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) !!!



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

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



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

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



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

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