Class: SuperDiff::Basic::OperationTreeFlatteners::MultilineString

Inherits:
Core::AbstractOperationTreeFlattener show all
Defined in:
lib/super_diff/basic/operation_tree_flatteners/multiline_string.rb

Instance Method Summary collapse

Methods inherited from Core::AbstractOperationTreeFlattener

#call

Instance Method Details

#build_tiered_linesObject



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/super_diff/basic/operation_tree_flatteners/multiline_string.rb', line 7

def build_tiered_lines
  operation_tree.map do |operation|
    Core::Line.new(
      type: operation.name,
      indentation_level: indentation_level,
      # TODO: Test that quotes and things don't get escaped but escape
      # characters do
      value:
        operation.value.inspect[1..-2].gsub('\\"', '"').gsub("\\'", "'")
    )
  end
end