Class: Card::Diff::Result
Defined Under Namespace
Classes: Summary
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.
- #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.
4 5 6 |
# File 'lib/card/diff/result.rb', line 4 def adds_cnt @adds_cnt end |
#complete ⇒ Object
Returns the value of attribute complete.
4 5 6 |
# File 'lib/card/diff/result.rb', line 4 def complete @complete end |
#dels_cnt ⇒ Object
Returns the value of attribute dels_cnt.
4 5 6 |
# File 'lib/card/diff/result.rb', line 4 def dels_cnt @dels_cnt end |
#summary ⇒ Object
Returns the value of attribute summary.
4 5 6 |
# File 'lib/card/diff/result.rb', line 4 def summary @summary end |
Instance Method Details
#write_added_chunk(text) ⇒ Object
16 17 18 19 20 |
# File 'lib/card/diff/result.rb', line 16 def write_added_chunk text @adds_cnt += 1 @complete << Card::Diff.render_added_chunk(text) @summary.add text end |
#write_deleted_chunk(text) ⇒ Object
22 23 24 25 26 |
# File 'lib/card/diff/result.rb', line 22 def write_deleted_chunk text @dels_cnt += 1 @complete << Card::Diff.render_deleted_chunk(text) @summary.delete text end |
#write_excluded_chunk(text) ⇒ Object
33 34 35 |
# File 'lib/card/diff/result.rb', line 33 def write_excluded_chunk text @complete << text end |
#write_unchanged_chunk(text) ⇒ Object
28 29 30 31 |
# File 'lib/card/diff/result.rb', line 28 def write_unchanged_chunk text @complete << text @summary.omit end |