class Documentable::Index

Reference container

class Documentable::Index 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:

content part

The resulting meta part would be:

say $that-reference.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(:$pod!:@meta!:$origin!)

method url

Defined as

method url(--> Str)

Returns the URL assigned to this reference.

Type Graph

Type relations for Documentable::Index
perl6-type-graph Documentable::Index Documentable::Index Documentable Documentable Documentable::Index->Documentable Any Any Documentable->Any

Expand above chart

Routines supplied by class Documentable

Documentable::Index inherits from class Documentable, which provides the following routines:

(Documentable) submethod BUILD

Defined as

submethod BUILD(:$!name:$!kind!:@!subkinds:@!categories:$!pod!)

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 $doc = Documentable.new(
    kind     => Kind::Type,
    subkinds => ["a""b"],
    pod      => []
);
 
say $doc.english-list # OUTPUT: a and b␤»