| 1 | package KiokuDB::Error::MissingObjects; | ||||||||||
| 2 | 18 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | 18 | ▶ | use namespace::clean -except => "meta"; # autoclean kills overloads | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 18 | ▶ | use overload '""' => "as_string"; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 18 | with qw(KiokuDB::Error); | |||||||||
| 9 | |||||||||||
| 10 | 18 | has ids => ( | |||||||||
| 11 | isa => "ArrayRef[Str]", | ||||||||||
| 12 | reader => "_ids", | ||||||||||
| 13 | required => 1, | ||||||||||
| 14 | ); | ||||||||||
| 15 | |||||||||||
| 16 | 53 | ▶ | sub ids { @{ shift->_ids } } | ||||||||
|
Subroutine
ids: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 17 | |||||||||||
| 18 | sub as_string { | ||||||||||
| 19 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
as_string: not called CC=1 SCAR=6.9
Pod
undocumented
| |||||||||||
| 20 | |||||||||||
| 21 | 0 | local $, = ", "; | |||||||||
| 22 | 0 | return "Objects missing in database: @{ $self->_ids }"; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | sub missing_ids_are { | ||||||||||
| 26 | 53 | ▶ | my ( $self, @ids ) = @_; | ||||||||
|
Subroutine
missing_ids_are: called CC=3 SCAR=11.0
Pod
undocumented
| |||||||||||
| 27 | |||||||||||
| 28 | 53 | my %ids = map { $_ => 1 } $self->ids; | |||||||||
| 29 | |||||||||||
| 30 | 53 | foreach my $id ( @ids ) { | |||||||||
| 31 | 53 | ▶ | return unless delete $ids{$id}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 53 | return ( keys(%ids) == 0 ) | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 18 | __PACKAGE__->meta->make_immutable; | |||||||||
| 38 | |||||||||||
| 39 | # ex: set sw=4 et: | ||||||||||
| 40 | |||||||||||
| 41 | 18 | __PACKAGE__ | |||||||||
| 42 | |||||||||||
| 43 | __END__ | ||||||||||