Class: Asciidoctor::PDF::IndexTerm

Inherits:
IndexTermGroup show all
Defined in:
lib/asciidoctor/pdf/index_catalog.rb

Instance Attribute Summary

Attributes inherited from IndexTermGroup

#name

Instance Method Summary collapse

Methods inherited from IndexTermGroup

#<=>, #store_term, #terms

Constructor Details

#initialize(name) ⇒ IndexTerm

Returns a new instance of IndexTerm.



104
105
106
107
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 104

def initialize name
  super
  @dests = ::Set.new
end

Instance Method Details

#add_dest(dest) ⇒ Object



111
112
113
114
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 111

def add_dest dest
  @dests << dest
  self
end

#container?Boolean

Returns:

  • (Boolean)


120
121
122
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 120

def container?
  @dests.empty? || @dests.none? {|d| d.key? :page }
end

#destsObject



116
117
118
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 116

def dests
  @dests.select {|d| d.key? :page }.sort_by {|d| d[:page_sortable] }
end

#leaf?Boolean

Returns:

  • (Boolean)


124
125
126
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 124

def leaf?
  @terms.empty?
end