The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

OODoc::Object - base class for all OODoc classes.

INHERITANCE

 OODoc::Object is extended by
   OODoc
   OODoc::Format
   OODoc::Manifest
   OODoc::Manual
   OODoc::Parser
   OODoc::Text

SYNOPSIS

 # Never instantiated directly.

DESCRIPTION

METHODS

Initiation

OODoc::Object->new(OPTIONS)

Inheritance

$obj->extends([OBJECT])

    Close to all elements used within OODoc can have an inheritance relation. The returned object is extended by the current object. Multiple inheritance is not supported here.

Commonly used functions

$obj->filenameToPackage(FILENAME)

OODoc::Object->filenameToPackage(FILENAME)

    Example:

     print $self->filenameToPackage('Mail/Box.pm'); # prints Mail::Box

$obj->mergeObjects(OPTIONS)

    Merge two lists of objects: "this" list and "super" list. The "this" objects are defined on this level of inheritance, where the "super" objects are from an inheritence level higher (super class). The combined list is returned.

    Merging is a complicated task, because the order of both lists should be kept as well as possible.

     Option  Defined in       Default                 
     equal                    sub {"$_[0]" eq "$_[1]"}
     merge                    sub {$_[0]}             
     super                    []                      
     this                     []                      

    . equal CODE

      Define how can be determined that two objects are the same. By default, the stringification of both objects are compared.

    . merge CODE

      What to call if both lists contain the same object. These two objects will be passed as argument to the code reference.

    . super ARRAY

    . this ARRAY

$obj->mkdirhier(DIRECTORY)

OODoc::Object->mkdirhier(DIRECTORY)

    Creates this DIRECTORY and all its non-existing parents.

$obj->unique

Manual database

All manuals can be reached everywhere in the program: it is a global collection.

$obj->addManual(MANUAL)

    The MANUAL will be added to the list of known manuals. The same package name can appear in more than one manual. This OBJECT shall be of type OODoc::Manual.

$obj->mainManual(NAME)

    Returns the manual of the named package which contains the primar documentation for the code of the package NAME.

$obj->manuals

    All manuals are returned.

$obj->manualsForPackage(NAME)

    Returns a list package objects which are related to the specified NAME. One NAME can appear in more than one file, and therefore a list is returned.

$obj->packageNames

    Returns the names of all defined packages.

DIAGNOSTICS

Error: manual definition requires manual object

A call to addManual() expects a new manual object (a OODoc::Manual), however an incompatible thing was passed. Usually, intended was a call to manualsForPackage() or mainManual().

Warning: order conflict "$take" before "$insert" in $file line $number

The order of the objects in a sub-class shall be the same as that of the super class, otherwise the result of merging of the information received from both classes is undertermined.