class method
PrettyPrint.singleline_format
(?untyped output, ?::Integer? maxwidth, ?::String? newline, ?^(::Integer) -> ::Integer? genspace) { (::PrettyPrint::SingleLine) -> untyped } -> ::PrettyPrint::_Output
singleline_format(output=''.dup, maxwidth=nil, newline=nil, genspace=nil) { |q| ... }
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prettyprint.rb, line 62
def PrettyPrint.singleline_format(output=''.dup, maxwidth=nil, newline=nil, genspace=nil)
q = SingleLine.new(output)
yield q
output
end
This is similar to PrettyPrint::format but the result has no breaks.
maxwidth, newline and genspace are ignored.
The invocation of breakable in the block doesn’t break a line and is treated as just an invocation of text.