class EPUB::ContentDocument::Navigation::Item

Attributes

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

Public Class Methods

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

Public Instance Methods

href=(iri) click to toggle source
# File lib/epub/content_document/navigation.rb, line 88
def href=(iri)
  @href = iri.kind_of?(Addressable::URI) ? iri : Addressable::URI.parse(iri)
end
traverse(depth=0, &block) click to toggle source
# File lib/epub/content_document/navigation.rb, line 92
def traverse(depth=0, &block)
  block.call self, depth
  items.each do |item|
    item.traverse depth + 1, &block
  end
end
type() click to toggle source

For backward compatibility

# File lib/epub/content_document/navigation.rb, line 100
def type
  types.find {|t|
    Type::TYPES.include? t
  }
end
type=(t) click to toggle source

For backward compatibility

# File lib/epub/content_document/navigation.rb, line 107
def type=(t)
  types << t
end