Validation::Class::Collection(3pm)

Validation::Class::Collection3pm

Generic container class for various collections

Usage

    use Validation::Class::Collection;
    
    my $foos = Validation::Class::Collection->new;
    
    $foos->add(foo => Foo->new);
    
    print $foos->count; # 1 object

Version

version 7.70

Overview

Validation::Class::Collection provides an all-purpose container for hash objects. This class is primarily used as a base class for collection management classes.

Methods

new

    my $self = Validation::Class::Collection->new;

add

    $self = $self->add(foo => Foo->new);
    
    $self->add(foo => Foo->new, bar => Bar->new);

clear

    $self = $self->clear;

count

    my $count = $self->count;

each

    $self = $self->each(sub{
        
        my ($name, $object) = @_;
        ...
        
    });

find

    my $matches = $self->find(qr/update_/); # hashref

get

    my $object = $self->get($name);

has

    if ($self->has($name)) {
        ...
    }

hash

    my $hash = $self->hash;

keys

    my @keys = $self->keys;

list

    my @objects = $self->list;

remove

    $object = $self->remove($name);

values

    my @objects = $self->values;

Author

Al Newkirk <[email protected]>

From libvalidation-class-perl 7.70-1 in Debian 7 (Wheezy). Parsed by carta from the page's man source.