class Link
Represents a link to a definition in the documentation.
Definitions
def initialize(range, definition)
Initialize a new link.
Signature
-
parameter
rangeRange The range of text to link.
-
parameter
definitionDefinition The definition to link to.
Implementation
def initialize(range, definition)
@definition = definition
super(range)
end
def apply(output, rewriter)
Apply the link to the output.
Signature
-
parameter
outputString The output to append to.
-
parameter
rewriterRewriter The rewriter instance.
Implementation
def apply(output, rewriter)
output << rewriter.link_to(
@definition,
rewriter.text_for(@range)
)
return self.size
end