Class: OpticalDiff::DiffResult
- Inherits:
-
Object
- Object
- OpticalDiff::DiffResult
- Defined in:
- lib/optical_diff.rb
Instance Attribute Summary collapse
-
#diff ⇒ Object
readonly
Returns the value of attribute diff.
Instance Method Summary collapse
- #changed? ⇒ Boolean
- #changes ⇒ Object
-
#initialize(diff) ⇒ DiffResult
constructor
A new instance of DiffResult.
Constructor Details
#initialize(diff) ⇒ DiffResult
Returns a new instance of DiffResult.
40 41 42 |
# File 'lib/optical_diff.rb', line 40 def initialize(diff) @diff = diff end |
Instance Attribute Details
#diff ⇒ Object (readonly)
Returns the value of attribute diff.
38 39 40 |
# File 'lib/optical_diff.rb', line 38 def diff @diff end |
Instance Method Details
#changed? ⇒ Boolean
48 49 50 |
# File 'lib/optical_diff.rb', line 48 def changed? changes.size > 0 end |
#changes ⇒ Object
44 45 46 |
# File 'lib/optical_diff.rb', line 44 def changes @diff.select {|line| line =~ /^[+-]/ } end |