Class: ANSI::Diff
- Inherits:
-
Object
- Object
- ANSI::Diff
- Defined in:
- lib/ansi/diff.rb
Overview
Diff can produced a colorized difference of two string or objects.
IMPORTANT! This class is still a very much a work in progress.
Instance Method Summary collapse
- #diff1 ⇒ Object
- #diff2 ⇒ Object
-
#initialize(object1, object2, options = {}) ⇒ Diff
constructor
A new instance of Diff.
- #to_s ⇒ Object
Constructor Details
#initialize(object1, object2, options = {}) ⇒ Diff
Returns a new instance of Diff.
11 12 13 14 15 16 |
# File 'lib/ansi/diff.rb', line 11 def initialize(object1, object2, ={}) @object1 = convert(object1) @object2 = convert(object2) @diff1, @diff2 = diff_string(@object1, @object2) end |
Instance Method Details
#diff1 ⇒ Object
19 20 21 |
# File 'lib/ansi/diff.rb', line 19 def diff1 @diff1 end |
#diff2 ⇒ Object
24 25 26 |
# File 'lib/ansi/diff.rb', line 24 def diff2 @diff2 end |
#to_s ⇒ Object
29 30 31 |
# File 'lib/ansi/diff.rb', line 29 def to_s "#{@diff1}\n#{@diff2}" end |