class PrettyPrint::SingleLine
PrettyPrint::SingleLine is used by PrettyPrint.singleline_format
It is passed to be similar to a PrettyPrint object itself, by responding to: * text * breakable * nest * group * flush * first?
but instead, the output has no line breaks
Public Class Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 334
def initialize: (String | untyped output, ?Integer? maxwidth, ?String? newline) -> void
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.
Public Instance Methods
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 354
def breakable: (?String sep, ?Integer? width) -> void
Appends sep to the text to be output. By default sep is ‘ ’
width argument is here for compatibility. It is a noop argument.
() → bool
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 381
def first?: () -> bool
This is used as a predicate, and ought to be called first.
() → nil
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 373
def flush: () -> nil
(?Integer? indent, ?String open_obj, ?String close_obj, ?Integer? open_width, ?Integer? close_width) { () → untyped } → untyped
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 371
def group: (?Integer? indent, ?String open_obj, ?String close_obj, ?Integer? open_width, ?Integer? close_width) { () -> untyped } -> untyped
Opens a block for grouping objects to be pretty printed.
Arguments: * indent - noop argument. Present for compatibility. * open_obj - text appended before the &blok. Default is ” * close_obj - text appended after the &blok. Default is ” * open_width - noop argument. Present for compatibility. * close_width - noop argument. Present for compatibility.
(untyped indent) { () → untyped } → void
Source
# File vendor/bundle/ruby/4.0.0/gems/rbs-4.0.3/stdlib/prettyprint/0/prettyprint.rbs, line 356
def nest: (untyped indent) { () -> untyped } -> void