Class: Localer::Data::Processor
- Defined in:
- lib/localer/data/processor.rb
Overview
Parse translations into hash: key: translation key value: hash of locale values
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#locales ⇒ Object
readonly
Returns the value of attribute locales.
Instance Method Summary collapse
Methods inherited from Service
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
15 16 17 |
# File 'lib/localer/data/processor.rb', line 15 def data @data end |
#locales ⇒ Object (readonly)
Returns the value of attribute locales.
15 16 17 |
# File 'lib/localer/data/processor.rb', line 15 def locales @locales end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/localer/data/processor.rb', line 17 def call @data = Hash.new { |hsh, key| hsh[key] = {} } @locales = [] translations.each do |(locale, translation)| next unless config.locale[locale.downcase].enabled @locales.push locale prepare(locale, translation) end [@locales, @data] end |