DR::Tarantool::Tuple - tuple container for DR::Tarantool
my $tuple = new DR::Tarantool::Tuple([ 1, 2, 3]); my $tuple = new DR::Tarantool::Tuple([ 1, 2, 3], $space); my $tuple = unpack DR::Tarantool::Tuple([ 1, 2, 3], $space); $tuple->next( $other_tuple ); $f = $tuple->raw(0); $f = $tuple->name_field;
Tuple contains normalized (unpacked) fields. You can access the fields by their indexes (see raw function) or by their names (if they are described in space).
Each tuple can contain references to next tuple and iterator. So If You extract more than one tuple, You can access them.
Constructor.
my $t = DR::Tarantool::Tuple->new([1, 2, 3]); my $t = DR::Tarantool::Tuple->new([1, 2, 3], $space);
my $t = DR::Tarantool::Tuple->unpack([1, 2, 3], $space);
Returns raw data from tuple.
my $array = $tuple->raw; my $field = $tuple->raw(0);
Appends or returns the following tuple.
my $next_tuple = $tuple->next;
Returns iterator linked with the tuple.
my $iterator = $tuple->iter; while(my $t = $iterator->next) { # the first value of $t and $tuple are the same ... }
Each tuple autoloads fields by their names that defined in space.
my $name = $tuple->password; # space contains field with name 'password' my $name = $tuple->login; ...
my $iter = DR::Tarantool::Tuple::Iterator->new( $tuple ); my $iter = $tuple->iter; # the same
Returns count of tuples in the iterator.
my $count = $iter->count;
Resets iterator (see next method).
$iter->reset;
Returns next element from the iterator.
my $iter = $tuple->iter; while(my $tuple = $iter->next) { ... }
Copyright (C) 2011 Dmitry E. Oboukhov <unera@debian.org> Copyright (C) 2011 Roman V. Nikolaev <rshadow@rambler.ru> This program is free software, you can redistribute it and/or modify it under the terms of the Artistic License.
The project is placed git repo on github: https://github.com/unera/dr-tarantool/.
To install DR::Tarantool, copy and paste the appropriate command in to your terminal.
cpanm
cpanm DR::Tarantool
CPAN shell
perl -MCPAN -e shell install DR::Tarantool
For more information on module installation, please visit the detailed CPAN module installation guide.