Class: Fifa::CountryIndex

Inherits:
Object
  • Object
show all
Defined in:
lib/fifa/countries.rb

Overview

built-in countries for (quick starter) auto-add

Instance Method Summary collapse

Constructor Details

#initialize(recs) ⇒ CountryIndex

Returns a new instance of CountryIndex.



9
10
11
12
13
# File 'lib/fifa/countries.rb', line 9

def initialize( recs )
  @countries = {}   ## countries by fifa code

  add( recs )
end

Instance Method Details

#[](key) ⇒ Object



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

def []( key )
  key = key.to_s.upcase   ## allow symbols (and always upcase e.g. aut to AUT etc.)
  @countries[ key ]
end

#countriesObject

all country records



15
16
17
# File 'lib/fifa/countries.rb', line 15

def countries  ## all country records
  @countries.values
end