Class: SuperDiff::OperationTreeBuilders::Array

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/operation_tree_builders/array.rb

Defined Under Namespace

Classes: LcsCallbacks

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.applies_to?(expected, actual) ⇒ Boolean

Returns:

  • (Boolean)


4
5
6
# File 'lib/super_diff/operation_tree_builders/array.rb', line 4

def self.applies_to?(expected, actual)
  expected.is_a?(::Array) && actual.is_a?(::Array)
end

Instance Method Details

#callObject



8
9
10
11
# File 'lib/super_diff/operation_tree_builders/array.rb', line 8

def call
  Diff::LCS.traverse_balanced(expected, actual, lcs_callbacks)
  operation_tree
end

#operation_treeObject



24
25
26
# File 'lib/super_diff/operation_tree_builders/array.rb', line 24

def operation_tree
  @_operation_tree ||= OperationTrees::Array.new([])
end