NAME
SQL::Engine::Collection - Generic Object Container
ABSTRACT
Generic Object Container
SYNOPSIS
use SQL::Engine::Collection;
my $collection = SQL::Engine::Collection->new;
# $collection->count;
# 0
DESCRIPTION
This package provides a generic container for working with sets of objects.
LIBRARIES
This package uses type constraints from:
ATTRIBUTES
This package has the following attributes:
items
items(ArrayRef[Object])
This attribute is read-only, accepts (ArrayRef[Object])
values, and is optional.
METHODS
This package implements the following methods:
clear
clear() : Bool
The clear method clears the collection and returns an empty list.
count
count() : Int
The count method counts and returns the number of items in the collection.
each
each(CodeRef $value) : ArrayRef[Any]
The each method iterates through the collection executing the callback for each item and returns the set of results.
first
first() : Maybe[Object]
The first method returns the first item in the collection.
last
last() : Maybe[Object]
The last method returns the last item in the collection.
list
list() : ArrayRef
The list method returns the collection as a list of items.
pop
pop() : Maybe[Object]
The pop method removes and returns an item from the tail of the collection.
pull
pull() : Maybe[Object]
The pull method removes and returns an item from the head of the collection.
push
push(Object @values) : Int
The push method inserts an item onto the tail of the collection and returns the count.
AUTHOR
Al Newkirk, awncorp@cpan.org
LICENSE
Copyright (C) 2011-2019, Al Newkirk, et al.
This is free software; you can redistribute it and/or modify it under the terms of the The Apache License, Version 2.0, as elucidated in the "license file".