Method: PrettyPrint::SingleLine#group
- Defined in:
- lib/prettyprint.rb
#group(indent = nil, open_obj = '', close_obj = '', open_width = nil, close_width = nil) ⇒ Object
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.
557 558 559 560 561 562 563 |
# File 'lib/prettyprint.rb', line 557 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 |