Class: I18nChecker::Locale::Texts

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Includes:
Enumerable
Defined in:
lib/i18n_checker/locale/texts.rb

Overview

List of translated text

Instance Method Summary collapse

Constructor Details

#initialize(texts = []) ⇒ Texts

Create list of translated text

Parameters:



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

Returns:

  • (Boolean)


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

Parameters:

Returns:



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

Returns:



34
35
36
37
# File 'lib/i18n_checker/locale/texts.rb', line 34

def uniq!
  @texts.uniq!
  self
end