class EPUB::ContentDocument::Navigation
Attributes
Public Class Methods
Source
# File lib/epub/content_document/navigation.rb, line 10 def initialize @navigations = [] @hidden = false @parent = nil super end
Calls superclass method
Public Instance Methods
Source
# File lib/epub/content_document/navigation.rb, line 30 def contents enum_for(:each_content).to_a end
Enumerator version of toc
Source
# File lib/epub/content_document/navigation.rb, line 43 def each_content toc.traverse do |content, _| yield content end end
iterator for toc
Source
# File lib/epub/content_document/navigation.rb, line 55 def each_landmark raise NotImplementedError end
iterator for landmark
Source
# File lib/epub/content_document/navigation.rb, line 50 def each_page raise NotImplementedError end
iterator for page_list
Source
# File lib/epub/content_document/navigation.rb, line 25 def landmarks navigations.find(&:landmarks?) end
Source
# File lib/epub/content_document/navigation.rb, line 21 def page_list navigations.find(&:page_list?) end
Source
# File lib/epub/content_document/navigation.rb, line 36 def pages raise NotImplementedError end
Enumerator version of page_list
Usage: navigation.enum_for(:pages)
Source
# File lib/epub/content_document/navigation.rb, line 17 def toc navigations.find(&:toc?) end