Module: I18nData

Extended by:
I18nData
Included in:
I18nData
Defined in:
lib/i18n_data.rb,
lib/i18n_data/file_data_provider.rb,
lib/i18n_data/live_data_provider.rb

Defined Under Namespace

Modules: FileDataProvider, LiveDataProvider Classes: NoTranslationAvailable

Instance Method Summary collapse

Instance Method Details

#countries(language_code = 'EN') ⇒ Object



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

def countries(language_code='EN')
  data_provider.codes(:countries,language_code.to_s.upcase)
end

#data_providerObject



13
14
15
16
17
18
19
20
# File 'lib/i18n_data.rb', line 13

def data_provider
  if @data_provider
    @data_provider
  else
    require 'i18n_data/file_data_provider'
    FileDataProvider
  end
end

#data_provider=(provider) ⇒ Object



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

def data_provider=(provider)
  @data_provider = provider
end

#languages(language_code = 'EN') ⇒ Object



5
6
7
# File 'lib/i18n_data.rb', line 5

def languages(language_code='EN')
  data_provider.codes(:languages,language_code.to_s.upcase)
end