new

new(output='', maxwidth=79, newline="\n", &genspace)
Class Public methods

Creates a buffer for pretty printing.

output is an output target. If it is not specified, '' is assumed. It should have a << method which accepts the first argument obj of #text, the first argument sep of #breakable, the first argument newline of ::new, and the result of a given block for ::new.

maxwidth specifies maximum line length. If it is not specified, 79 is assumed. However actual outputs may overflow maxwidth if long non-breakable texts are provided.

newline is used for line breaks. ânâ is used if it is not specified.

The block is used to generate spaces. {|width| ' ' * width} is used if it is not given.

doc_ruby_on_rails
2015-04-28 10:01:57
Comments
Leave a Comment

Please login to continue.