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

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

Defined Under Namespace

Modules: Type

Instance Attribute Summary collapse

Attributes inherited from Item

#content_document, #href, #item, #items, #text

Attributes included from Hidable

#hidden, #parent

Instance Method Summary collapse

Methods inherited from Item

#traverse

Methods included from Hidable

#hidden?

Constructor Details

#initializeNavigation

Returns a new instance of Navigation



110
111
112
113
# File 'lib/epub/content_document/navigation.rb', line 110

def initialize
  super
  @types = Set.new
end

Instance Attribute Details

#typesObject

Returns the value of attribute types



104
105
106
# File 'lib/epub/content_document/navigation.rb', line 104

def types
  @types
end

Instance Method Details

#typeObject

For backward compatibility



120
121
122
123
124
# File 'lib/epub/content_document/navigation.rb', line 120

def type
  @types.find {|t|
    %w[toc page_list landmarks].include? t
  }
end

#type=(t) ⇒ Object

For backward compatibility



127
128
129
# File 'lib/epub/content_document/navigation.rb', line 127

def type=(t)
  @types << t
end