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.



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

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

Instance Attribute Details

#content_documentObject

Returns the value of attribute content_document.



74
75
76
# File 'lib/epub/content_document/navigation.rb', line 74

def content_document
  @content_document
end

#hrefObject

Returns the value of attribute href.



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

def href
  @href
end

#itemObject

Returns the value of attribute item.



74
75
76
# File 'lib/epub/content_document/navigation.rb', line 74

def item
  @item
end

#itemsObject

Returns the value of attribute items.



74
75
76
# File 'lib/epub/content_document/navigation.rb', line 74

def items
  @items
end

#textObject

Returns the value of attribute text.



74
75
76
# File 'lib/epub/content_document/navigation.rb', line 74

def text
  @text
end

Instance Method Details

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



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

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