class CBOR::PP
Public Class Methods
add_annotations(tree, ann_list)
click to toggle source
# File lib/cbor-pp.rb, line 125 def self.add_annotations(tree, ann_list) tree.cbor_add_annotations_from(ann_list) end
pp(obj, out=$>, width=79)
click to toggle source
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.
CBOR::PP.pp
returns out
.
# File lib/cbor-pp.rb, line 13 def self.pp(obj, out=$>, width=79) q = new(out, width) q.pp obj q.flush #$pp = q out << "\n" end