Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
class method
PrettyPrint::SingleLine.new
(::String | untyped output, ?::Integer? maxwidth, ?::String? newline) -> ::PrettyPrint::SingleLine
new(output, maxwidth=nil, newline=nil)
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.1.0-preview1/lib/prettyprint.rb, line 508
def initialize(output, maxwidth=nil, newline=nil)
@output = output
@first = [true]
end
Create a PrettyPrint::SingleLine object
Arguments:
-
output-String(or similar) to store rendered text. Needs to respond to ‘<<’ -
maxwidth- Argument position expected to be here for compatibility.This argument is a noop.
-
newline- Argument position expected to be here for compatibility.This argument is a noop.