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.
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
120
121
122
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 120
def container?
@dests.empty? || @dests.none? {|d| d.key? :page }
end
|
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
124
125
126
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 124
def leaf?
@terms.empty?
end
|