class PDFBeads::PDFBuilder::PDFTOC::PDFTOCItem
This class represents a single TOC item with its parent node and next/previous siblings.
Public Instance Methods
getChildrenCount()
click to toggle source
# File lib/pdfbeads/pdftoc.rb, line 59 def getChildrenCount() cnt = self[:children].length self[:children].each do |child| if child[:open] and child[:children].length > 0 cnt = cnt + child.getChildrenCount end end return cnt end
prevSibling( indent )
click to toggle source
# File lib/pdfbeads/pdftoc.rb, line 69 def prevSibling( indent ) if has_key? :parent and self[:indent] > indent return self[:parent].prevSibling( indent ) end return self if self[:indent] == indent return nil end