Class: Card::Content::Diff::Result
- Inherits:
-
Object
- Object
- Card::Content::Diff::Result
- Defined in:
- lib/card/content/diff/result.rb
Overview
Result object for Diff processing
Instance Attribute Summary collapse
-
#adds_cnt ⇒ Object
Returns the value of attribute adds_cnt.
-
#complete ⇒ Object
Returns the value of attribute complete.
-
#dels_cnt ⇒ Object
Returns the value of attribute dels_cnt.
-
#summary ⇒ Object
Returns the value of attribute summary.
Instance Method Summary collapse
-
#initialize(summary_opts = nil) ⇒ Result
constructor
A new instance of Result.
- #summary_omits_content? ⇒ Boolean
- #write_added_chunk(text) ⇒ Object
- #write_deleted_chunk(text) ⇒ Object
- #write_excluded_chunk(text) ⇒ Object
- #write_unchanged_chunk(text) ⇒ Object
Constructor Details
Instance Attribute Details
#adds_cnt ⇒ Object
Returns the value of attribute adds_cnt.
6 7 8 |
# File 'lib/card/content/diff/result.rb', line 6 def adds_cnt @adds_cnt end |
#complete ⇒ Object
Returns the value of attribute complete.
6 7 8 |
# File 'lib/card/content/diff/result.rb', line 6 def complete @complete end |
#dels_cnt ⇒ Object
Returns the value of attribute dels_cnt.
6 7 8 |
# File 'lib/card/content/diff/result.rb', line 6 def dels_cnt @dels_cnt end |
#summary ⇒ Object
Returns the value of attribute summary.
6 7 8 |
# File 'lib/card/content/diff/result.rb', line 6 def summary @summary end |
Instance Method Details
#summary_omits_content? ⇒ Boolean
19 20 21 |
# File 'lib/card/content/diff/result.rb', line 19 def summary_omits_content? @summary.omits_content? end |
#write_added_chunk(text) ⇒ Object
23 24 25 26 27 |
# File 'lib/card/content/diff/result.rb', line 23 def write_added_chunk text @adds_cnt += 1 @complete << Diff.render_added_chunk(text) @summary.add text end |
#write_deleted_chunk(text) ⇒ Object
29 30 31 32 33 |
# File 'lib/card/content/diff/result.rb', line 29 def write_deleted_chunk text @dels_cnt += 1 @complete << Diff.render_deleted_chunk(text) @summary.delete text end |
#write_excluded_chunk(text) ⇒ Object
40 41 42 |
# File 'lib/card/content/diff/result.rb', line 40 def write_excluded_chunk text @complete << text end |
#write_unchanged_chunk(text) ⇒ Object
35 36 37 38 |
# File 'lib/card/content/diff/result.rb', line 35 def write_unchanged_chunk text @complete << text @summary.omit end |