Class: Localer::Data
- Inherits:
-
Object
- Object
- Localer::Data
- Extended by:
- Dry::Initializer
- Defined in:
- lib/localer/data.rb,
lib/localer/data/checker.rb,
lib/localer/data/service.rb,
lib/localer/data/processor.rb,
lib/localer/data/missing_translations.rb
Overview
Stores translations and provides check methods
Defined Under Namespace
Classes: Checker, MissingTranslations, Processor, Service
Instance Attribute Summary collapse
-
#locales ⇒ Object
readonly
Returns the value of attribute locales.
-
#translations ⇒ Object
readonly
Returns the value of attribute translations.
Instance Method Summary collapse
- #complete? ⇒ Boolean
- #each ⇒ Object
-
#initialize(*args) ⇒ Data
constructor
A new instance of Data.
- #missing_translations ⇒ Object
Constructor Details
Instance Attribute Details
#locales ⇒ Object (readonly)
Returns the value of attribute locales.
16 17 18 |
# File 'lib/localer/data.rb', line 16 def locales @locales end |
#translations ⇒ Object (readonly)
Returns the value of attribute translations.
16 17 18 |
# File 'lib/localer/data.rb', line 16 def translations @translations end |
Instance Method Details
#complete? ⇒ Boolean
23 24 25 |
# File 'lib/localer/data.rb', line 23 def complete? Checker.call(self) end |
#each ⇒ Object
31 32 33 34 35 36 37 |
# File 'lib/localer/data.rb', line 31 def each @translations.each do |key, value| @locales.each do |locale| yield locale, key, value[locale] end end end |
#missing_translations ⇒ Object
27 28 29 |
# File 'lib/localer/data.rb', line 27 def missing_translations MissingTranslations.call(self) end |