Class: IsoCode::Iso3166

Inherits:
Base
  • Object
show all
Defined in:
lib/iso_code/iso3166.rb

Overview

This class gives a list of all countries in the ISO 3166 standard, and is used to provide translations in various languages

The translations and files are taken from the Debian iso-codes project (alioth.debian.org/projects/pkg-isocodes/)

Instance Attribute Summary

Attributes inherited from Base

#basexml, #dataset, #fileurl, #locales, #pofiles

Instance Method Summary collapse

Methods inherited from Base

#read

Constructor Details

#initialize(*locales) ⇒ Iso3166

Returns a new instance of Iso3166.



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/iso_code/iso3166.rb', line 12

def initialize(*locales)
  @locales = locales
  @dataset = {}

  @basexml = 'http://anonscm.debian.org/gitweb/?p=iso-codes/iso-codes.git;a=blob_plain;f=iso_3166/iso_3166.xml;hb=HEAD'
  @fileurl = 'http://anonscm.debian.org/gitweb/?p=iso-codes/iso-codes.git;a=blob_plain;f=iso_3166/%s.po;hb=HEAD'

  @pofiles = [
    :af, :am, :ar, :as, :ast, :az, :be, :bg, :bn, :bn_IN, :br, :bs, :byn, :ca, :crh, :cs, :cy, :da, :de, :dz, :el, :eo,
    :es, :et, :eu, :fa, :fi, :fo, :fr, :ga, :gez, :gl, :gu, :haw, :he, :hi, :hr, :hu, :hy, :id, :is, :it, :ja, :ka, :kk,
    :km, :kn, :ko, :ku, :lt, :lv, :mi, :mk, :ml, :mn, :mr, :ms, :mt, :nb, :ne, :nl, :nn, :nso, :oc, :or, :pa, :pl, :ps,
    :pt, :pt_BR, :ro, :ru, :rw, :sk, :sl, :so, :sq, :sr, :sv, :sw, :ta, :te, :th, :ti, :tig, :tk, :tl, :tr, :tt, :ug,
    :uk, :ve, :vi, :wa, :wal, :wo, :xh, :zh_CN, :zh_HK, :zh_TW, :zu
  ]
end