Class: I18nChecker::NotFound::Result
- Inherits:
-
Object
- Object
- I18nChecker::NotFound::Result
- Defined in:
- lib/i18n_checker/not_found/result.rb
Instance Attribute Summary collapse
-
#locale_texts ⇒ Object
readonly
Returns the value of attribute locale_texts.
Instance Method Summary collapse
- #each_file(&block) ⇒ Object
- #empty? ⇒ Boolean
-
#initialize(locale_texts = []) ⇒ Result
constructor
A new instance of Result.
Constructor Details
#initialize(locale_texts = []) ⇒ Result
Returns a new instance of Result.
6 7 8 |
# File 'lib/i18n_checker/not_found/result.rb', line 6 def initialize(locale_texts = []) @locale_texts = locale_texts end |
Instance Attribute Details
#locale_texts ⇒ Object (readonly)
Returns the value of attribute locale_texts.
4 5 6 |
# File 'lib/i18n_checker/not_found/result.rb', line 4 def locale_texts @locale_texts end |
Instance Method Details
#each_file(&block) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/i18n_checker/not_found/result.rb', line 14 def each_file(&block) file_texts = locale_texts.group_by(&:file) file_texts.each do |file, texts| texts.sort do |a, b| lr = a.line <=> b.line next lr if lr != 0 a.column <=> b.column end yield(file, texts) end end |
#empty? ⇒ Boolean
10 11 12 |
# File 'lib/i18n_checker/not_found/result.rb', line 10 def empty? locale_texts.empty? end |