The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.
package #
    FakeResultSet;
use Moose;

use MooseX::Iterator;

has 'rows' => (
    is => 'rw',
    isa => 'ArrayRef',
    default => sub { [] }
);

has 'iterator' => (
    is => 'rw',
    isa => 'MooseX::Iterator::Array',
    lazy => 1,
    default => sub { MooseX::Iterator::Array->new(collection => $_[0]->rows) },
    clearer => 'reset',
    handles => { next => 'next' }
);

1;