Class: I18nChecker::Locale::Texts
- Inherits:
-
Object
- Object
- I18nChecker::Locale::Texts
- Extended by:
- Forwardable
- Includes:
- Enumerable
- Defined in:
- lib/i18n_checker/locale/texts.rb
Overview
List of translated text
Instance Method Summary collapse
-
#==(other) ⇒ Boolean
Compare lists of translated texts.
- #[](key) ⇒ Object
-
#concat(texts) ⇒ I18nChecker::Locale::Texts<I18nChecker::Locale::Text>
Combine lists of translated texts.
- #detect(detector) ⇒ Object
-
#initialize(texts = []) ⇒ Texts
constructor
Create list of translated text.
-
#uniq! ⇒ I18nChecker::Locale::Texts<I18nChecker::Locale::Text>
Delete translated text duplicates.
Constructor Details
#initialize(texts = []) ⇒ Texts
Create list of translated text
18 19 20 |
# File 'lib/i18n_checker/locale/texts.rb', line 18 def initialize(texts = []) @texts = texts end |
Instance Method Details
#==(other) ⇒ Boolean
Compare lists of translated texts
42 43 44 |
# File 'lib/i18n_checker/locale/texts.rb', line 42 def ==(other) @texts == other.to_a end |
#[](key) ⇒ Object
46 47 48 |
# File 'lib/i18n_checker/locale/texts.rb', line 46 def [](key) @texts[key] end |
#concat(texts) ⇒ I18nChecker::Locale::Texts<I18nChecker::Locale::Text>
Combine lists of translated texts
26 27 28 29 |
# File 'lib/i18n_checker/locale/texts.rb', line 26 def concat(texts) @texts.concat(texts.to_a) self end |
#detect(detector) ⇒ Object
50 51 52 |
# File 'lib/i18n_checker/locale/texts.rb', line 50 def detect(detector) detector.detect(texts) end |
#uniq! ⇒ I18nChecker::Locale::Texts<I18nChecker::Locale::Text>
Delete translated text duplicates
34 35 36 37 |
# File 'lib/i18n_checker/locale/texts.rb', line 34 def uniq! @texts.uniq! self end |