Class: Asciidoctor::PDF::IndexTerm
Instance Attribute Summary
#name
Instance Method Summary
collapse
#<=>, #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
143
144
145
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 143
def container?
@dests.empty? || @dests.none? {|d| d.key? :page }
end
|
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
147
148
149
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 147
def leaf?
@terms.empty?
end
|