=encoding utf8

=head1 NAME

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

=head1 INHERITANCE

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

=head1 SYNOPSIS

  # Never instantiated directly.

=head1 DESCRIPTION

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

=head1 OVERLOADED

=over 4

=item overload: B<'!='> (numeric different)

Results in C<true> when the objects are different

=item overload: B<'=='> (numeric equivalent)

Numeric comparison is used to compare to objects whether they are
identical.  On many extensions, string comparison is overloaded to
compare the names of the objects.

=item overload: B<'bool'> 

Always returns C<true>: "exists".

=back

=head1 METHODS

=head2 Constructors

=over 4

=item $class-E<gt>B<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 C<new> is checked, in contrary to the
options when used with many other method defined by OODoc.

=back

=head2 Attributes

=over 4

=item $obj-E<gt>B<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.

=item $obj-E<gt>B<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

=back

=head1 DIAGNOSTICS

=over 4

=item Error: unknown object attribute '$name' for $pkg

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

=item Error: unknown object attributes for $pkg: '$names'

You have used more than one option which is not defined to instantiate
the object.
Cast by new()

=back

=head1 SEE ALSO

This module is part of OODoc version 3.04,
built on September 12, 2025. Website: F<https://perl.overmeer.net/oodoc/>

=head1 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.

