Class: FastGettext::TranslationRepository::Logger
- Defined in:
- lib/fast_gettext/translation_repository/logger.rb
Overview
This should be used in a TranslationRepository::Chain, so tat untranslated keys can be found Responsibility:
- log every translation call
Instance Attribute Summary collapse
-
#callback ⇒ Object
Returns the value of attribute callback.
Instance Method Summary collapse
- #[](key) ⇒ Object
-
#initialize(name, options = {}) ⇒ Logger
constructor
A new instance of Logger.
- #plural(*keys) ⇒ Object
Methods inherited from Base
#available_locales, #pluralisation_rule
Constructor Details
#initialize(name, options = {}) ⇒ Logger
Returns a new instance of Logger.
11 12 13 14 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 11 def initialize(name,={}) super self.callback = [:callback] end |
Instance Attribute Details
#callback ⇒ Object
Returns the value of attribute callback.
9 10 11 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 9 def callback @callback end |
Instance Method Details
#[](key) ⇒ Object
16 17 18 19 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 16 def [](key) callback.call(key) nil end |
#plural(*keys) ⇒ Object
21 22 23 24 |
# File 'lib/fast_gettext/translation_repository/logger.rb', line 21 def plural(*keys) callback.call(keys) [] end |