Class: SuperDiff::OperationTreeFlatteners::MultilineString

Inherits:
Base
  • Object
show all
Defined in:
lib/super_diff/operation_tree_flatteners/multiline_string.rb

Instance Method Summary collapse

Methods inherited from Base

#call

Instance Method Details

#build_tiered_linesObject



4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/super_diff/operation_tree_flatteners/multiline_string.rb', line 4

def build_tiered_lines
  operation_tree.map do |operation|
    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