Class: CBOR::PP

Inherits:
PrettyPrint show all
Includes:
PPMethods
Defined in:
lib/cbor-pp.rb

Defined Under Namespace

Modules: EqlMixin, ObjectMixin, PPMethods Classes: Cloak

Class Method Summary collapse

Methods included from PPMethods

#comma_breakable, #pp, #pp_hash, #seplist

Class Method Details

.add_annotations(tree, ann_list) ⇒ Object



125
126
127
# 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) ⇒ Object

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.



13
14
15
16
17
18
19
# 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