class Link
Represents a link to a definition in the documentation.
Definitions
def initialize(range, definition)
Initialize a new link.
Signature
-
parameter
range
Range
The range of text to link.
-
parameter
definition
Definition
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
output
String
The output to append to.
-
parameter
rewriter
Rewriter
The rewriter instance.
Implementation
def apply(output, rewriter)
output << rewriter.link_to(
@definition,
rewriter.text_for(@range)
)
return self.size
end