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.



127
128
129
130
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 127

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

Instance Method Details

#add_dest(dest) ⇒ Object



134
135
136
137
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 134

def add_dest dest
  @dests << dest
  self
end

#container?Boolean

Returns:

  • (Boolean)


143
144
145
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 143

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

#destsObject



139
140
141
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 139

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

#leaf?Boolean

Returns:

  • (Boolean)


147
148
149
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 147

def leaf?
  @terms.empty?
end