Class: SuperDiff::Basic::OperationTreeBuilders::Array

Inherits:
Core::AbstractOperationTreeBuilder show all
Defined in:
lib/super_diff/basic/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)


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

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

Instance Method Details

#callObject



13
14
15
16
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 13

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

#operation_treeObject



30
31
32
# File 'lib/super_diff/basic/operation_tree_builders/array.rb', line 30

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