instance method
PrettyPrint#group
(?::Integer indent, ?::String open_obj, ?::String close_obj, ?::Integer open_width, ?::Integer close_width) { () -> untyped } -> ::Integer
group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length) { || ... }
lib/prettyprint.rb
View on GitHub ↗
# File tmp/rubies/ruby-4.0.0/lib/prettyprint.rb, line 252
def group(indent=0, open_obj='', close_obj='', open_width=open_obj.length, close_width=close_obj.length)
text open_obj, open_width
group_sub {
nest(indent) {
yield
}
}
text close_obj, close_width
end
Groups line break hints added in the block. The line break hints are all to be used or not.
If indent is specified, the method call is regarded as nested by nest(indent) { … }.
If open_obj is specified, text open_obj, open_width is called before grouping. If close_obj is specified, text close_obj, close_width is called after grouping.