Class: Jazzy::DocIndex
- Inherits:
-
Object
- Object
- Jazzy::DocIndex
- Defined in:
- lib/jazzy/doc_index.rb
Overview
This class stores an index of symbol names for doing name lookup when resolving custom categories and autolinks.
Defined Under Namespace
Classes: LookupName, Scope
Instance Attribute Summary collapse
-
#root_scope ⇒ Object
readonly
Returns the value of attribute root_scope.
Instance Method Summary collapse
-
#initialize(all_decls) ⇒ DocIndex
constructor
A new instance of DocIndex.
-
#lookup(name, context = nil) ⇒ Object
Look up a name and return the matching SourceDeclaration or nil.
Constructor Details
Instance Attribute Details
#root_scope ⇒ Object (readonly)
Returns the value of attribute root_scope.
74 75 76 |
# File 'lib/jazzy/doc_index.rb', line 74 def root_scope @root_scope end |
Instance Method Details
#lookup(name, context = nil) ⇒ Object
Look up a name and return the matching SourceDeclaration or nil.
‘context` is an optional SourceDeclaration indicating where the text was found, affects name resolution - see `lookup_context()` below.
84 85 86 87 88 89 90 91 |
# File 'lib/jazzy/doc_index.rb', line 84 def lookup(name, context = nil) lookup_name = LookupName.new(name) return lookup_fully_qualified(lookup_name) if lookup_name.fully_qualified? return lookup_guess(lookup_name) if context.nil? lookup_context(lookup_name, context) end |