| Class | PP |
| In: |
lib/pp.rb
|
| Parent: | PrettyPrint |
| sharing_detection | [RW] | Returns the sharing detection flag as a boolean value. It is false by default. |
Outputs obj to out in pretty printed format of width columns in width.
If out is omitted, +$>+ is assumed. If width is omitted, 79 is assumed.
PP.pp returns out.
# File lib/pp.rb, line 75
75: def PP.pp(obj, out=$>, width=79)
76: q = PP.new(out, width)
77: q.guard_inspect_key {q.pp obj}
78: q.flush
79: #$pp = q
80: out << "\n"
81: end
Outputs obj to out like PP.pp but with no indent and newline.
PP.singleline_pp returns out.
# File lib/pp.rb, line 87
87: def PP.singleline_pp(obj, out=$>)
88: q = SingleLine.new(out)
89: q.guard_inspect_key {q.pp obj}
90: q.flush
91: out
92: end