SQL::Engine::Collection

Generic Object Container

Generic Object Container

method: clear method: count method: each method: first method: last method: list method: pop method: pull method: push

use SQL::Engine::Collection;

my $collection = SQL::Engine::Collection->new;

# $collection->count;

# 0

Types::Standard

items: ro, opt, ArrayRef[Object]

This package provides a generic container for working with sets of objects.

The clear method clears the collection and returns an empty list.

clear() : Bool

=example-1 clear

# given: synopsis

$collection->clear;

The count method counts and returns the number of items in the collection.

count() : Int

=example-1 count

# given: synopsis

$collection->count;

The each method iterates through the collection executing the callback for each item and returns the set of results.

each(CodeRef $value) : ArrayRef[Any]

=example-1 each

# given: synopsis

$collection->each(sub {
  my ($item) = shift;

  $item
});

The first method returns the first item in the collection.

first() : Maybe[Object]

=example-1 first

# given: synopsis

$collection->first;

The last method returns the last item in the collection.

last() : Maybe[Object]

=example-1 last

# given: synopsis

$collection->last;

The list method returns the collection as a list of items.

list() : ArrayRef

=example-1 list

# given: synopsis

$collection->list;

The pop method removes and returns an item from the tail of the collection.

pop() : Maybe[Object]

=example-1 pop

# given: synopsis

$collection->pop;

The pull method removes and returns an item from the head of the collection.

pull() : Maybe[Object]

=example-1 pull

# given: synopsis

$collection->pull;

The push method inserts an item onto the tail of the collection and returns the count.

push(Object @values) : Int

=example-1 push

# given: synopsis

$collection->push(bless {});

26 POD Errors

The following errors were encountered while parsing the POD:

Around line 10:

Unknown directive: =name

Around line 16:

Unknown directive: =tagline

Around line 22:

Unknown directive: =abstract

Around line 28:

Unknown directive: =includes

Around line 42:

Unknown directive: =synopsis

Around line 54:

Unknown directive: =libraries

Around line 60:

Unknown directive: =attributes

Around line 66:

Unknown directive: =description

Around line 72:

Unknown directive: =method

Around line 76:

Unknown directive: =signature

Around line 88:

Unknown directive: =method

Around line 92:

Unknown directive: =signature

Around line 104:

Unknown directive: =method

Around line 109:

Unknown directive: =signature

Around line 125:

Unknown directive: =method

Around line 129:

Unknown directive: =signature

Around line 141:

Unknown directive: =method

Around line 145:

Unknown directive: =signature

Around line 157:

Unknown directive: =method

Around line 161:

Unknown directive: =signature

Around line 173:

Unknown directive: =method

Around line 177:

Unknown directive: =signature

Around line 189:

Unknown directive: =method

Around line 193:

Unknown directive: =signature

Around line 205:

Unknown directive: =method

Around line 210:

Unknown directive: =signature