Class: Lookout::Difference::Array
- Defined in:
- lib/lookout-3.0/difference/array.rb
Overview
Difference reports between Arrays.
Instance Attribute Summary
Attributes inherited from Object
Instance Method Summary collapse
-
#diff ⇒ Diff::Formats::Unified, super
A unified “diff” between Object#actual and Object#expected unless Object#expected contains one element or Object#actual isn’t an Array, super otherwise.
Methods inherited from Object
#==, #hash, #initialize, #message, #to_s
Constructor Details
This class inherits a constructor from Lookout::Difference::Object
Instance Method Details
#diff ⇒ Diff::Formats::Unified, super
Returns A unified “diff” between Object#actual and Object#expected unless Object#expected contains one element or Object#actual isn’t an Array, super otherwise.
8 9 10 11 12 13 14 15 |
# File 'lib/lookout-3.0/difference/array.rb', line 8 def diff return super if expected.size == 1 or not Array === actual Lookout::Diff::Formats::Unified. new(Lookout::Diff::Groups. new(Lookout::Diff::Operations. new(Lookout::Diff::Algorithms::Difflib. new(actual, expected)))) end |