| 1 | package Rose::DB::Object::Iterator; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 61 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | |||||||||||||||
| 5 | 61 | ▶ | use Carp(); | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 6 | |||||||||||||||
| 7 | 61 | ▶ | use Rose::Object; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 8 | 61 | our @ISA = qw(Rose::Object); | |||||||||||||
| 9 | |||||||||||||||
| 10 | 61 | our $VERSION = '0.759'; | |||||||||||||
| 11 | |||||||||||||||
| 12 | use Rose::Object::MakeMethods::Generic | ||||||||||||||
| 13 | 61 | ▶ | ( | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 14 | 61 | scalar => | |||||||||||||
| 15 | [ | ||||||||||||||
| 16 | 'error', | ||||||||||||||
| 17 | '_count', | ||||||||||||||
| 18 | '_next_code', | ||||||||||||||
| 19 | '_finish_code', | ||||||||||||||
| 20 | '_destroy_code', | ||||||||||||||
| 21 | ], | ||||||||||||||
| 22 | |||||||||||||||
| 23 | 'boolean' => 'active', | ||||||||||||||
| 24 | 61 | ); | |||||||||||||
| 25 | |||||||||||||||
| 26 | sub next | ||||||||||||||
| 27 | 0 | ▶ | { | ||||||||||||
|
Subroutine
next: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||||
| 28 | 0 | my($self) = shift; | |||||||||||||
| 29 | 0 | my $ret = $self->_next_code->($self, @_); | |||||||||||||
| 30 | 0 | ▶ | $self->active(0) unless($ret); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 31 | 0 | return $ret; | |||||||||||||
| 32 | } | ||||||||||||||
| 33 | |||||||||||||||
| 34 | sub finish | ||||||||||||||
| 35 | 0 | ▶ | { | ||||||||||||
|
Subroutine
finish: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 36 | 0 | my($self) = shift; | |||||||||||||
| 37 | 0 | $self->active(0); | |||||||||||||
| 38 | 0 | ▶ | $self->_next_code(sub { 0 }); | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||||||
| 39 | 0 | return $self->_finish_code->($self, @_); | |||||||||||||
| 40 | } | ||||||||||||||
| 41 | |||||||||||||||
| 42 | sub DESTROY | ||||||||||||||
| 43 | 0 | ▶ | { | ||||||||||||
|
Subroutine
DESTROY: not called CC=3 SCAR=24.8
| |||||||||||||||
| 44 | 0 | my($self) = shift; | |||||||||||||
| 45 | |||||||||||||||
| 46 | 0 | ▶ | if($self->active) | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 47 | { | ||||||||||||||
| 48 | 0 | $self->finish; | |||||||||||||
| 49 | } | ||||||||||||||
| 50 | elsif(my $code = $self->_destroy_code) | ||||||||||||||
| 51 | { | ||||||||||||||
| 52 | 0 | $code->($self); | |||||||||||||
| 53 | } | ||||||||||||||
| 54 | } | ||||||||||||||
| 55 | |||||||||||||||
| 56 | 0 | ▶ | sub total { shift->{'_count'} } | ||||||||||||
|
Subroutine
total: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||
| 57 | |||||||||||||||
| 58 | 61 | 1; | |||||||||||||
| 59 | |||||||||||||||
| 60 | __END__ | ||||||||||||||