class Documentable::Index
Reference container
is Documentable
Used to represent and handle the "X<>"
elements found in a pod.
Methods
method origin
Defined as
method origin(--> Documentable::Primary)
Returns the Documentable::Primary object where the reference was found.
method meta
Defined as
method meta(--> Array[Str])
Returns the meta part corresponding to the reference. You need to have in mind how the meta part is parsed. Given the following reference element:
The resulting meta part would be:
say .meta # OUTPUT: [["a1","a2"],["b1", "b2"]]
So ,
is a first-level separator, and ;
is a second-level separator.
A Documentable::Index
object is created by each second-level element found. So, in the previous case, two different objects would have been created (one using ["a1", "a2"]
and the other using ["b1", "b2"]
).
method new
Defined as
method new(:!, :!, :!)
@meta
: second-level separator associated to this object.$origin
: Documentable::Primary object where this reference was found.$mame
is assigned following the content of@meta
:If
@meta
is equal to["a", "b", "c"]
, then$name
will be set to"c (a b)"
.If
@meta
is equal to["a"]
, then$name
will be set to"a"
.$kind
will always be set toKind::Reference
.
method url
Defined as
method url(--> Str)
Returns the URL assigned to this reference.
Type Graph
Routines supplied by class Documentable
Documentable::Index inherits from class Documentable, which provides the following routines:
(Documentable) submethod BUILD
Defined as
submethod BUILD(:, :!, :, :, :!)
Returns a Documentable
object correctly initialized.
(Documentable) method name
Defined as
method name(--> Str)
Returns $!name
. You must have in mind that this value is not unique, so there could be more than one Documentable
instance with the same name.
(Documentable) method kind
Defined as
method kind(--> Kind)
Returns $!kind
. See Kind to get more info.
(Documentable) method pod
Defined as
method pod(--> Pod::Block)
Returns $!pod
. $!pod
is the documentation represented by this object.
(Documentable) method subkinds
Defined as
method subkinds(-->Array[Str])
Returns @!subkinds
.
(Documentable) method categories
Returns @!categories
. If @!categories
is not defined, @!subkinds
will be returned instead.
(Documentable) method english-list
Defined as:
method english-list()
This is a helper method used to convert lists (@.subkinds
) to an "english" format.
my = Documentable.new(kind => Kind::Type,subkinds => ["a", "b"],pod => []);say .english-list # OUTPUT: a and b»