Class: I18nLinterRb::Linter
- Inherits:
-
Object
- Object
- I18nLinterRb::Linter
- Defined in:
- lib/i18n_linter_rb/linter.rb
Instance Attribute Summary collapse
-
#source_locale ⇒ Object
readonly
Returns the value of attribute source_locale.
-
#target_locale ⇒ Object
readonly
Returns the value of attribute target_locale.
Instance Method Summary collapse
-
#initialize(source_locale:, target_locale:) ⇒ Linter
constructor
A new instance of Linter.
- #missing_keys_in_target(source_path, target_path) ⇒ Object
Constructor Details
#initialize(source_locale:, target_locale:) ⇒ Linter
Returns a new instance of Linter.
7 8 9 10 |
# File 'lib/i18n_linter_rb/linter.rb', line 7 def initialize(source_locale:, target_locale:) @source_locale = source_locale @target_locale = target_locale end |
Instance Attribute Details
#source_locale ⇒ Object (readonly)
Returns the value of attribute source_locale.
5 6 7 |
# File 'lib/i18n_linter_rb/linter.rb', line 5 def source_locale @source_locale end |
#target_locale ⇒ Object (readonly)
Returns the value of attribute target_locale.
5 6 7 |
# File 'lib/i18n_linter_rb/linter.rb', line 5 def target_locale @target_locale end |
Instance Method Details
#missing_keys_in_target(source_path, target_path) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/i18n_linter_rb/linter.rb', line 12 def missing_keys_in_target(source_path, target_path) source_keys = locale_keys(source_path) target_keys = locale_keys(target_path) source_keys - target_keys end |