NAME

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

INHERITANCE

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

SYNOPSIS

# Never instantiated directly.

DESCRIPTION

Any object used in the OODoc module is derived from this OODoc::Object class. This means that all functionality in this class is provided for all of the other classes.

OVERLOADED

overload: '==' and '!=' (numeric comparison)

Numeric comparison is used to compare to objects whether they are identical. String comparison is overloaded to compare the names of the objects.

overload: 'bool'

Always returns true: "exists".

METHODS

Constructors

$class->new(%options)

Create a new object (instantiation). All objects in OODoc are created the same way: they carry a list of key-value pairs as option. For examples, see the description of this method in the manual page of the specific object.

The validity of the options for new is checked, in contrary to the options when used with many other method defined by OODoc.

Attributes

$obj->unique()

Returns a unique id for this text item. This is the easiest way to see whether two references to the same (overloaded) objects point to the same thing. The ids are numeric.

example:

if($obj1->unique == $obj2->unique) {...}
if($obj1 == $obj2) {...}   # same via overload

Manual Repository

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->findManual($name)

[3.00] Returns the manual with the specified name, or else undef.

$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.

$obj->publicationIndex()

Returns the collected objects for publication.

$obj->publish(\%options)

Extract the data of an object for export, and register it in the index. A HASH is returned which should get filled with useful data.

DIAGNOSTICS

Error: Unknown object attribute '$name' for $pkg

You have used the option with $name, which is not defined with the instantiation (the new method) of this object.

Error: Unknown object attributes for $pkg: '$names'

You have used more than one option which is not defined to instantiate the object.

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().

SEE ALSO

This module is part of OODoc version 3.02, built on August 15, 2025. Website: https://perl.overmeer.net/oodoc/

LICENSE

For contributors see file ChangeLog.

This software is copyright (c) 2003-2025 by Mark Overmeer.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.