Class: EPUB::ContentDocument::Navigation::Item

Inherits:
Object
  • Object
show all
Includes:
Hidable
Defined in:
lib/epub/content_document/navigation.rb

Direct Known Subclasses

Navigation

Instance Attribute Summary collapse

Attributes included from Hidable

#hidden, #parent

Instance Method Summary collapse

Methods included from Hidable

#hidden?

Constructor Details

#initializeItem

Returns a new instance of Item



80
81
82
83
# File 'lib/epub/content_document/navigation.rb', line 80

def initialize
  @items = ItemList.new
  @items.parent = self
end

Instance Attribute Details

#content_documentObject

Returns the value of attribute content_document



76
77
78
# File 'lib/epub/content_document/navigation.rb', line 76

def content_document
  @content_document
end

#hrefObject

Returns the value of attribute href



78
79
80
# File 'lib/epub/content_document/navigation.rb', line 78

def href
  @href
end

#itemObject

Returns the value of attribute item



76
77
78
# File 'lib/epub/content_document/navigation.rb', line 76

def item
  @item
end

#itemsObject

Returns the value of attribute items



76
77
78
# File 'lib/epub/content_document/navigation.rb', line 76

def items
  @items
end

#textObject

Returns the value of attribute text



76
77
78
# File 'lib/epub/content_document/navigation.rb', line 76

def text
  @text
end

Instance Method Details

#traverse(depth = 0, &block) ⇒ Object



89
90
91
92
93
94
# File 'lib/epub/content_document/navigation.rb', line 89

def traverse(depth=0, &block)
  block.call self, depth
  items.each do |item|
    item.traverse depth + 1, &block
  end
end