Teek API Documentation

Build-phase debug tooling: a readable ASCII tree of a Document’s current shape, and (opt-in) a step-by-step trace of how it got there. Deliberately its own class, not methods on Document/Node - those stay focused on constructing/indexing/parent-tracking the retained tree; this is purely an outside observer of it, built the same way an app author’s own tooling would be (see Document#subscribe).

Inherits: Object

Instance Methods

initialize(document, trace: false)

Parameters
  • document Document
  • trace Boolean — subscribe to document's own internal build-event hook immediately, recording every stack push/pop and node append from this point on - see #log. false (the default) costs nothing beyond this object's own existence: document never learns whether a TreeInspector is watching or not, on or off.

Returns TreeInspector — a new instance of TreeInspector

print_tree

#to_s, straight to stdout.

Returns void

to_s

A readable ASCII tree of the document’s CURRENT shape - type, name, and (where present) opts[:text]/opts[:label], box-drawn by nesting. Reflects whatever the tree looks like right now; call it again after more building to see the updated shape.

Returns String

Example
root
└─ column
   ├─ label "Title"
   ├─ row
   │  ├─ button "OK"
   │  └─ button "Cancel"
   └─ label "Footer"
Attributes

log [R]

Returns Array<Event> — every push/pop/append recorded so far, in order - always empty unless constructed with trace: true

Members: Classes (1)