class

Similar::UnifiedDiffHunk(T)

Inherits Reference < Object

Unified diff hunk formatter.

Constructors

new(ops : Array(DiffOp), diff : TextDiff(T), missing_newline_hint : Bool)

Creates a new hunk for some operations.

Source

Instance methods

header

Returns the header for the hunk.

Source
iter_changes

Iterates over all changes in a hunk.

Source
missing_newline_hint

Returns the value of the missing_newline_hint flag.

Source
ops

Returns all operations in the hunk.

Source
to_s(io : IO) : Nil

Returns the hunk as a string.

Source
to_writer(io : IO) : Nil

Write the hunk as bytes to the output stream.

Source