Module: LLT::Review::Helpers::ReviewReporter
- Included in:
- Alignment::Difference::Nrefs, Alignment::Difference::Translation, Common::Difference::Sentence, Common::Difference::Word, Treebank::Difference::Generic
- Defined in:
- lib/llt/review/helpers/diff_reporter.rb
Instance Attribute Summary collapse
-
#unique ⇒ Object
readonly
While all classes that include ReviewReporter also include HashContainable, we cannot include it here, as HashContainable contains ClassMethods that otherwise won’t reach the object that need it.
Instance Method Summary collapse
- #diff_id ⇒ Object
- #initialize(item) ⇒ Object
- #item ⇒ Object
- #report_diff(report, uniques = nil) ⇒ Object
- #xml_attributes ⇒ Object
Instance Attribute Details
#unique ⇒ Object (readonly)
While all classes that include ReviewReporter also include HashContainable, we cannot include it here, as HashContainable contains ClassMethods that otherwise won’t reach the object that need it
8 9 10 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 8 def unique @unique end |
Instance Method Details
#diff_id ⇒ Object
19 20 21 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 19 def diff_id @diff_id ||= "#{id}:#{map { |_, v| v.diff_id }.join('::')}" end |
#initialize(item) ⇒ Object
10 11 12 13 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 10 def initialize(item) super(item.id) @item = item end |
#item ⇒ Object
15 16 17 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 15 def item @item end |
#report_diff(report, uniques = nil) ⇒ Object
27 28 29 30 31 32 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 27 def report_diff(report, uniques = nil) report_unique = report_unique?(uniques) @unique = report_unique ? 1 : 0 write_to_report(report, report_unique) each_value { |v| v.report_diff(report, uniques) } end |
#xml_attributes ⇒ Object
23 24 25 |
# File 'lib/llt/review/helpers/diff_reporter.rb', line 23 def xml_attributes super.merge(unique: @unique) end |