class EPUB::ContentDocument::Navigation::Item

Attributes

content_document[RW]
href[RW]
item[RW]
items[RW]
text[RW]

Public Class Methods

new() click to toggle source
# File lib/epub/content_document/navigation.rb, line 67
def initialize
  @items = ItemList.new
  @items.parent = self
end

Public Instance Methods

traverse(depth=0, &block) click to toggle source
# File lib/epub/content_document/navigation.rb, line 72
def traverse(depth=0, &block)
  block.call self, depth
  items.each do |item|
    item.traverse depth + 1, &block
  end
end