Class: Riddick::Backends::Simple
- Inherits:
-
Object
- Object
- Riddick::Backends::Simple
- Defined in:
- lib/riddick/backends/simple.rb
Overview
Wrapper aroud I18n::Backend::Simple.
Instance Attribute Summary collapse
-
#i18n_backend ⇒ Object
readonly
Returns the value of attribute i18n_backend.
Instance Method Summary collapse
-
#init_translations ⇒ Object
Ensure the translations are loaded.
-
#initialize(i18n_backend) ⇒ Simple
constructor
A new instance of Simple.
-
#translations ⇒ Object
Calculate and return the default translations as a hash of type: => ‘baz!’.
Constructor Details
#initialize(i18n_backend) ⇒ Simple
Returns a new instance of Simple.
7 8 9 |
# File 'lib/riddick/backends/simple.rb', line 7 def initialize(i18n_backend) @i18n_backend = i18n_backend end |
Instance Attribute Details
#i18n_backend ⇒ Object (readonly)
Returns the value of attribute i18n_backend.
5 6 7 |
# File 'lib/riddick/backends/simple.rb', line 5 def i18n_backend @i18n_backend end |
Instance Method Details
#init_translations ⇒ Object
Ensure the translations are loaded.
18 19 20 |
# File 'lib/riddick/backends/simple.rb', line 18 def init_translations @i18n_backend.send :init_translations end |
#translations ⇒ Object
Calculate and return the default translations as a hash of type: => ‘baz!’
13 14 15 |
# File 'lib/riddick/backends/simple.rb', line 13 def translations @i18n_backend.send(:translations)[I18n.locale].riddick_normalize_i18n I18n.locale end |