PrettyPrint
This class implements a pretty printing algorithm. It finds line breaks and nice indentations for grouped structure.
References
Constructors
Class methods
Pretty prints obj into io with the given width as a limit and starting with the given indentation.
Instance methods
Similar to #breakable except
the decision to break or not is determined individually.
Creates a group of objects. Inside a group all breakable objects are either turned into newlines or are output as is, depending on the available width.
Appends a list of elements surrounded by left and right and separated by commas, yielding each element to the given block.
Appends a list of elements surrounded by left and right and separated by commas.
Appends a group that is surrounded by the given left and right objects, and optionally is surrounded by the given breakable objects.