Class: PDFium::BookmarkList
- Inherits:
-
Object
- Object
- PDFium::BookmarkList
- Includes:
- Enumerable
- Defined in:
- lib/pdfium/bookmark_list.rb
Overview
A list of bookmarks for a Document or a Bookmark
Instance Method Summary collapse
-
#each ⇒ Object
Calls block once for each bookmark that exists at the current level Since bookmarks form a tree, each bookmark may have one or more children.
-
#empty? ⇒ Boolean
True if no bookmarks exist, false if at least one is present.
-
#initialize(initial) ⇒ BookmarkList
constructor
Not used directly, but called from Document#bookmarks.
Constructor Details
#initialize(initial) ⇒ BookmarkList
Not used directly, but called from Document#bookmarks
8 9 10 |
# File 'lib/pdfium/bookmark_list.rb', line 8 def initialize(initial) @first=initial end |
Instance Method Details
#each ⇒ Object
Calls block once for each bookmark that exists at the current level Since bookmarks form a tree, each bookmark may have one or more children
14 15 16 17 18 19 20 |
# File 'lib/pdfium/bookmark_list.rb', line 14 def each bookmark = @first while bookmark yield bookmark bookmark = bookmark.next_sibling end end |
#empty? ⇒ Boolean
True if no bookmarks exist, false if at least one is present
23 24 25 |
# File 'lib/pdfium/bookmark_list.rb', line 23 def empty? @first.nil? end |