Module: Thailand

Defined in:
lib/thailand.rb,
lib/thailand/i18n.rb,
lib/thailand/utils.rb,
lib/thailand/region.rb,
lib/thailand/country.rb,
lib/thailand/version.rb,
lib/thailand/district.rb,
lib/thailand/province.rb,
lib/thailand/querying.rb,
lib/thailand/region_collection.rb

Defined Under Namespace

Modules: I18n, Querying, Utils Classes: Country, District, Province, Region, RegionCollection

Constant Summary collapse

VERSION =
'1.0.0'

Class Attribute Summary collapse

Class Method Summary collapse

Class Attribute Details

.data_pathsObject

Returns the value of attribute data_paths.



14
15
16
# File 'lib/thailand.rb', line 14

def data_paths
  @data_paths
end

.i18n_backendObject

Returns the value of attribute i18n_backend.



14
15
16
# File 'lib/thailand.rb', line 14

def i18n_backend
  @i18n_backend
end

.root_pathObject

Returns the value of attribute root_path.



14
15
16
# File 'lib/thailand.rb', line 14

def root_path
  @root_path
end

Class Method Details

.clear_data_pathsObject



16
17
18
19
# File 'lib/thailand.rb', line 16

def clear_data_paths
  Country.instance.reset!
  @data_paths = []
end

.reset_data_pathsObject



21
22
23
24
# File 'lib/thailand.rb', line 21

def reset_data_paths
  clear_data_paths
  @data_paths << Pathname.new(@root_path + 'data')
end

.reset_i18n_backendObject



26
27
28
29
# File 'lib/thailand.rb', line 26

def reset_i18n_backend
  base_locale_path =  @root_path + 'locale'
  @i18n_backend = Thailand::I18n::Simple.new(base_locale_path)
end