Class: Asciidoctor::PDF::IndexTerm
Instance Attribute Summary collapse
#name
Instance Method Summary
collapse
#<=>, #store_term, #terms
Constructor Details
#initialize(name) ⇒ IndexTerm
Returns a new instance of IndexTerm.
154
155
156
157
158
159
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 154
def initialize name
super
@dests = ::Set.new
@anchor = %(__indextermdef-#{(::Digest::MD5.new << name.to_s).hexdigest})
@associations = @see = @see_also = nil
end
|
Instance Attribute Details
Returns the value of attribute anchor.
146
147
148
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 146
def anchor
@anchor
end
|
#associations ⇒ Object
Returns the value of attribute associations.
148
149
150
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 148
def associations
@associations
end
|
Returns the value of attribute see.
150
151
152
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 150
def see
@see
end
|
180
181
182
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 180
def see_also
@see_also&.sort
end
|
Instance Method Details
#add_dest(dest) ⇒ Object
163
164
165
166
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 163
def add_dest dest
@dests << dest
self
end
|
#container? ⇒ Boolean
172
173
174
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 172
def container?
@dests.empty? || @dests.none? {|d| d.key? :page }
end
|
168
169
170
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 168
def dests
@dests.select {|d| d.key? :page }.sort_by {|d| d[:page_sortable] }
end
|
#leaf? ⇒ Boolean
176
177
178
|
# File 'lib/asciidoctor/pdf/index_catalog.rb', line 176
def leaf?
@terms.empty?
end
|