Validation::Class::Collection - Generic Container Class for Various Collections
version 7.84
use Validation::Class::Collection; my $foos = Validation::Class::Collection->new; $foos->add(foo => Foo->new); print $foos->count; # 1 object
Validation::Class::Collection provides an all-purpose container for hash objects. This class is primarily used as a base class for collection management classes.
my $self = Validation::Class::Collection->new;
$self = $self->add(foo => Foo->new); $self->add(foo => Foo->new, bar => Bar->new);
$self = $self->clear;
my $count = $self->count;
$self = $self->each(sub{ my ($name, $object) = @_; ... });
my $matches = $self->find(qr/update_/); # hashref
my $object = $self->get($name);
if ($self->has($name)) { ... }
my $hash = $self->hash;
my @keys = $self->keys;
my @objects = $self->list;
$object = $self->remove($name);
my @objects = $self->values;
Al Newkirk <anewkirk@ana.io>
This software is copyright (c) 2011 by Al Newkirk.
This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
To install Validation::Class, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Validation::Class
CPAN shell
perl -MCPAN -e shell install Validation::Class
For more information on module installation, please visit the detailed CPAN module installation guide.