Tom Molesworth > EntityModel-Class-0.012 > EntityModel::Array

Download:
EntityModel-Class-0.012.tar.gz

Dependencies

Annotate this POD

Website

CPAN RT

Open  0
View/Report Bugs
Module Version: 0.012   Source   Latest Release: EntityModel-Class-0.015

NAME ^

EntityModel::Array - wrapper object for dealing with arrayrefs

VERSION ^

version 0.012

DESCRIPTION ^

Primarily intended as an abstract interface for use with EntityModel backend storage.

METHODS ^

new

Instantiates with the given arrayref

count

Returns the number of items in the arrayref.

list

Returns all items from the arrayref.

push

Push the requested value onto the end of the arrayref.

add_watch

Add a coderef to be called when the array changes.

remove_watch : method

Removes a watch from this array.

Returns $self.

shift

Shift the first value out of the arrayref.

pop

Pops the last value from the arrayref.

unshift

Unshifts a value onto the start of the arrayref.

join

Joins the entries in the arrayref using the given value and returns as a scalar.

each

Perform coderef on each entry in the arrayref.

first

Returns the first entry in the arrayref.

last

Returns the last entry in the arrayref.

grep

Calls the coderef on each entry in the arrayref and returns the entries for which it returns true.

remove

Remove entries from the array.

Avoid rebuilding the array in case we have weak refs, just splice out the values indicated.

clear

Empty the arrayref.

arrayref

Returns the arrayref directly.

is_empty

Returns true if there's nothing in the arrayref.

SEE ALSO ^

Use autobox instead.

AUTHOR ^

Tom Molesworth <cpan@entitymodel.com>

LICENSE ^

Copyright Tom Molesworth 2008-2011. Licensed under the same terms as Perl itself.

syntax highlighting: