class Canon::Diff::DiffLine
def initialize(line_number:, content:, type:, diff_node: nil,
-
old_content(String, nil) -- Deprecated: multi-line old content -
new_content(String, nil) -- The text2 line content (for :changed lines) -
new_char_ranges(Array) -- Character ranges for text2 side -
char_ranges(Array) -- Character ranges for text1 side -
formatting(Boolean) -- Whether this is a formatting-only difference -
diff_node(DiffNode, nil) -- The semantic diff node this line belongs to -
type(Symbol) -- The type of line (:unchanged, :added, :removed, :changed) -
content(String) -- The text content of the line (from text1) -
new_position(Integer, nil) -- The 0-based line number in text2 (new text), -
line_number(Integer) -- The 0-based line number in text1 (old text)
def initialize(line_number:, content:, type:, diff_node: nil, formatting: false, new_position: nil, old_content: nil, char_ranges: nil, new_char_ranges: nil, new_content: nil) @line_number = line_number @new_position = new_position @content = content @type = type @diff_node = diff_node @formatting = formatting @old_content = old_content @char_ranges = char_ranges || [] @new_char_ranges = new_char_ranges || [] @new_content = new_content end