Class: Fifa::CountryIndex
- Inherits:
-
Object
- Object
- Fifa::CountryIndex
- Defined in:
- lib/fifa/countries.rb
Overview
built-in countries for (quick starter) auto-add
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#countries ⇒ Object
all country records.
-
#initialize(recs) ⇒ CountryIndex
constructor
A new instance of CountryIndex.
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 |
#countries ⇒ Object
all country records
15 16 17 |
# File 'lib/fifa/countries.rb', line 15 def countries ## all country records @countries.values end |