Class: SuperDiff::Basic::OperationTreeBuilders::MultilineString
- Inherits:
-
Core::AbstractOperationTreeBuilder
- Object
- Core::AbstractOperationTreeBuilder
- SuperDiff::Basic::OperationTreeBuilders::MultilineString
- Defined in:
- lib/super_diff/basic/operation_tree_builders/multiline_string.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(*args) ⇒ MultilineString
constructor
A new instance of MultilineString.
Methods inherited from Core::AbstractOperationTreeBuilder
Constructor Details
#initialize(*args) ⇒ MultilineString
Returns a new instance of MultilineString.
14 15 16 17 18 19 20 21 22 |
# File 'lib/super_diff/basic/operation_tree_builders/multiline_string.rb', line 14 def initialize(*args) super @original_expected = @expected @original_actual = @actual @expected = split_into_lines(@expected) @actual = split_into_lines(@actual) @sequence_matcher = PatienceDiff::SequenceMatcher.new end |
Class Method Details
.applies_to?(expected, actual) ⇒ Boolean
9 10 11 12 |
# File 'lib/super_diff/basic/operation_tree_builders/multiline_string.rb', line 9 def self.applies_to?(expected, actual) expected.is_a?(::String) && actual.is_a?(::String) && (expected.include?("\n") || actual.include?("\n")) end |