Class: IsoCode::Base

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

Overview

This class acts as base class for various iso code classes to implement methods that will be used on all classes

Direct Known Subclasses

Iso3166, Iso639

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#basexmlObject

The path for the base XML file



15
16
17
# File 'lib/iso_code/base.rb', line 15

def basexml
  @basexml
end

#datasetObject

Save the parsed content hash



12
13
14
# File 'lib/iso_code/base.rb', line 12

def dataset
  @dataset
end

#fileurlObject

The url to the available po files



18
19
20
# File 'lib/iso_code/base.rb', line 18

def fileurl
  @fileurl
end

#localesObject

Save the requested locales



9
10
11
# File 'lib/iso_code/base.rb', line 9

def locales
  @locales
end

#pofilesObject

The name for the available PO files



21
22
23
# File 'lib/iso_code/base.rb', line 21

def pofiles
  @pofiles
end

Instance Method Details

#readObject

Read all requested files and return hash



24
25
26
27
28
29
# File 'lib/iso_code/base.rb', line 24

def read
  parse_basexml
  parse_pofiles

  @dataset
end