class I18nChecker::Locale::Texts

List of translated text

Attributes

texts[R]

Public Class Methods

new(texts = []) click to toggle source

Create list of translated text

@param texts [Array<I18nChecker::Locale::Text>] List of translated text

# File lib/i18n_checker/locale/texts.rb, line 18
def initialize(texts = [])
  @texts = texts
end

Public Instance Methods

==(other) click to toggle source

Compare lists of translated texts

@return [Boolean]

# File lib/i18n_checker/locale/texts.rb, line 42
def ==(other)
  @texts == other.to_a
end
[](key) click to toggle source
# File lib/i18n_checker/locale/texts.rb, line 46
def [](key)
  @texts[key]
end
concat(texts) click to toggle source

Combine lists of translated texts

@param texts [Enumerable<I18nChecker::Locale::Text>] List of translated text @return [I18nChecker::Locale::Texts<I18nChecker::Locale::Text>] Returns the combined receiver itself

# File lib/i18n_checker/locale/texts.rb, line 26
def concat(texts)
  @texts.concat(texts.to_a)
  self
end
detect(detector) click to toggle source
# File lib/i18n_checker/locale/texts.rb, line 50
def detect(detector)
  detector.detect(texts)
end
uniq!() click to toggle source

Delete translated text duplicates

@return [I18nChecker::Locale::Texts<I18nChecker::Locale::Text>] Returns the combined receiver itself

# File lib/i18n_checker/locale/texts.rb, line 34
def uniq!
  @texts.uniq!
  self
end