class Documentable

Represents a self-contained Raku documentation element.

class Documentable {}

This class is the base for Documentable::Primary and Documentable::Secondary. Everything documented is represented by a child class of Documentable.

Methods

submethod BUILD

Defined as

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

Returns a Documentable object correctly initialized.

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.

method kind

Defined as

method kind(--> Kind)

Returns $!kind. See Kind to get more info.

method pod

Defined as

method pod(--> Pod::Block)

Returns $!pod. $!pod is the documentation represented by this object.

method subkinds

Defined as

method subkinds(-->Array[Str])

Returns @!subkinds.

method categories

Returns @!categories. If @!categories is not defined, @!subkinds will be returned instead.

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␤» 
 

Type Graph

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

Expand above chart