Zing::Table - Entity Lookup Table
Entity Lookup Table Construct
use Zing::Table; my $table = Zing::Table->new(name => 'users'); # my $domain = $table->set('unique-id');
This package provides an index and lookup-table for Zing::Repo derived data structures which provides the ability to create a collection of repo objects.
This package inherits behaviors from:
Zing::Channel
This package uses type constraints from:
Zing::Types
This package has the following attributes:
position(Maybe[Int])
This attribute is read-write, accepts (Maybe[Int]) values, and is optional.
(Maybe[Int])
type(TableType)
This attribute is read-only, accepts (TableType) values, and is optional.
(TableType)
This package implements the following methods:
count() : Int
The count method returns the number of Zing::Repo objects in the table.
# given: synopsis $table->count;
# given: synopsis $table->set('user-12345'); $table->count;
drop() : Int
The drop method returns truthy if the table has been destroyed. This operation does not cascade.
# given: synopsis $table->drop;
fetch(Int $size = 1) : ArrayRef[Repo]
The fetch method returns the next n Zing::Repo objects from the table.
n
# given: synopsis $table->fetch;
# given: synopsis $table->set('user-12345'); $table->set('user-12346'); $table->set('user-12347'); $table->fetch(5);
first() : Maybe[Repo]
The first method returns the first Zing::Repo object created in the table.
# given: synopsis $table->first;
get(Str $key) : Maybe[Repo]
The get method returns the Zing::Repo associated with a specific key.
# given: synopsis $table->get('user-12345');
head() : Maybe[Repo]
The head method returns the first Zing::Repo object created in the table.
# given: synopsis $table->head;
index(Int $position) : Maybe[Repo]
The index method returns the Zing::Repo object at the position (index) specified.
# given: synopsis $table->index(0);
last() : Maybe[Repo]
The last method returns the last Zing::Repo object created in the table.
# given: synopsis $table->last;
next() : Maybe[Repo]
The next method returns the next Zing::Repo object created in the table.
# given: synopsis $table->next;
# given: synopsis $table->position(undef); $table->prev; $table->prev; $table->next;
# given: synopsis $table->position($table->size); $table->prev; $table->next; $table->prev;
prev() : Maybe[Repo]
The prev method returns the previous Zing::Repo object created in the table.
# given: synopsis $table->prev;
# given: synopsis $table->next; $table->next; $table->prev;
# given: synopsis $table->position($table->size); $table->next; $table->next; $table->prev;
# given: synopsis $table->position(undef); $table->next; $table->prev; $table->next;
renew() : Int
The renew method returns truthy if it resets the internal cursor, otherwise falsy.
# given: synopsis $table->renew;
reset() : Int
The reset method always reset the internal cursor and return truthy.
# given: synopsis $table->reset;
set(Str $key) : Repo
The set method creates a Zing::Repo association with a specific key in the table. The key should be unique. Adding the same key will result in duplicate entries.
# given: synopsis $table->set('user-12345');
tail() : Maybe[Repo]
The tail method returns the last Zing::Repo object created in the table.
# given: synopsis $table->tail;
term() : Str
The term method returns the name of the table.
# given: synopsis $table->term;
Al Newkirk, awncorp@cpan.org
awncorp@cpan.org
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".
Wiki
Project
Initiatives
Milestones
Contributing
Issues
To install Zing, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Zing
CPAN shell
perl -MCPAN -e shell install Zing
For more information on module installation, please visit the detailed CPAN module installation guide.