Class: InertiaI18n::Converter
- Inherits:
-
Object
- Object
- InertiaI18n::Converter
- Defined in:
- lib/inertia_i18n/converter.rb
Constant Summary collapse
- PLURAL_KEYS =
%w[zero one two few many other].freeze
Instance Method Summary collapse
- #convert ⇒ Object
-
#initialize(yaml_data, locale:) ⇒ Converter
constructor
A new instance of Converter.
Constructor Details
#initialize(yaml_data, locale:) ⇒ Converter
Returns a new instance of Converter.
7 8 9 10 11 |
# File 'lib/inertia_i18n/converter.rb', line 7 def initialize(yaml_data, locale:) @yaml_data = yaml_data @locale = locale.to_s @config = InertiaI18n.configuration end |
Instance Method Details
#convert ⇒ Object
13 14 15 16 |
# File 'lib/inertia_i18n/converter.rb', line 13 def convert data = @yaml_data[@locale] || {} process(data) end |