| Pangloss documentation | Contained in the Pangloss distribution. |
Pangloss::Concepts - a collection of Pangloss concepts.
use Pangloss::Concepts;
my $concepts = new Pangloss::Concepts();
try {
my $concept = $concepts->get( $name );
$concepts->add( $concept );
$concepts->remove( $concept );
do { ... } foreach ( $concepts->list );
} catch Pangloss::Concept::Error with {
my $e = shift;
...
}
This class contains a collection of Pangloss::Concept objects. It inherits its interface from Pangloss::Collection.
The collection is keyed on $concept->name().
synonym for $obj->keys()
Steve Purkis <spurkis@quiup.com>
| Pangloss documentation | Contained in the Pangloss distribution. |
package Pangloss::Concepts; use strict; use warnings::register; use Error; use Pangloss::Concept; use Pangloss::Concept::Error; use Pangloss::StoredObject::Error; use base qw( Pangloss::Collection ); our $VERSION = ((require Pangloss::Version), $Pangloss::VERSION)[1]; our $REVISION = (split(/ /, ' $Revision: 1.5 $ '))[2]; sub names { return shift->keys; } sub error_key_nonexistent { my $self = shift; my $name = shift; throw Pangloss::Concept::Error(flag => eNonExistent, name => $name); } sub error_key_exists { my $self = shift; my $name = shift; throw Pangloss::Concept::Error(flag => eExists, name => $name); } 1; __END__ #------------------------------------------------------------------------------