instance method
PrettyPrint::SingleLine#group
(?::Integer? indent, ?::String open_obj, ?::String close_obj, ?::Integer? open_width, ?::Integer? close_width) { () -> untyped } -> untyped
group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil) { || ... }
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prettyprint.rb, line 540
def group(indent=nil, open_obj='', close_obj='', open_width=nil, close_width=nil)
@first.push true
@output << open_obj
yield
@output << close_obj
@first.pop
end
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.