DR-Tarantool

 view release on metacpan or  search on metacpan

lib/DR/Tarantool/Iterator.pm  view on Meta::CPAN

    my ($self, $no) = @_;

    my $item = $self->raw_item( $no );

    if (my $class = $self->item_class) {

        if (my $m = $self->item_constructor) {
            return $class->$m( $item, $no, $self );
        }

        return bless $item => $class if ref $item;
        return bless \$item => $class;
    }

    return $self->{items}[ $no ];
}


=head2 raw_item

Return one raw tuple from the iterator by its index 
(or croak error if the index is out of range).

t/040-tuple.t  view on Meta::CPAN

isa_ok $iter->{items}[1] => 'ARRAY', "item[1] isn't blessed";

$tp = DR::Tarantool::Tuple->new([ qw(a b c d e f g h i) ], $s->space('test'));
is_deeply $tp->raw, [ qw(a b c d e f g h i) ], 'tuple->raw';
is_deeply $tp->tail, [ qw(g h i) ], 'tuple->tail';

package TestItem;

sub new1 {
    my ($class, $tuple) = @_;
    return bless { tuple => $tuple } => $class;
}




 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.841 second using v1.00-cache-2.02-grep-82fe00e-cpan-503542c4f10 )