NAME

DBIx::MoCo::List - Array iterator for DBIx::MoCo.

SYNOPSIS

my $array_ref = [
  {name => 'jkondo'},
  {name => 'cinnamon'}
];
my $list = DBIx::MoCo::List->new($array_ref);

$list->size; # 2
my @names = $list->map_name; # ('jkondo','cinnamon')
my $first = $list->pop; # first hash

METHODS

index_of

Returns index of given target or given code returns true.

my $list = DBIx::MoCo::List->new([0,1,2,3]);
ok ($list, 'list');
is ($list->index_of(1), 1, 'index of 1');
ok (!$list->index_of(4), 'index of 4');
is ($list->index_of(sub { shift == 2 }), 2, 'index of sub(2)');

SEE ALSO

DBIx::MoCo

AUTHOR

Junya Kondo, <jkondo@hatena.com>, Naoya Ito, <naoya@hatena.ne.jp>

COPYRIGHT AND LICENSE

Copyright (C) Hatena Inc. All Rights Reserved.

This library is free software; you may redistribute it and/or modify it under the same terms as Perl itself.