line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::Toodledo::InternalWrapper; |
2
|
|
|
|
|
|
|
|
3
|
10
|
|
|
10
|
|
5190
|
use Carp; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
692
|
|
4
|
10
|
|
|
10
|
|
64
|
use Package::Stash; |
|
10
|
|
|
|
|
22
|
|
|
10
|
|
|
|
|
212
|
|
5
|
10
|
|
|
10
|
|
49
|
use Moose; |
|
10
|
|
|
|
|
20
|
|
|
10
|
|
|
|
|
62
|
|
6
|
10
|
|
|
10
|
|
61107
|
use MooseX::Method::Signatures; |
|
10
|
|
|
|
|
23
|
|
|
10
|
|
|
|
|
106
|
|
7
|
|
|
|
|
|
|
with 'MooseX::Log::Log4perl'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
our $VERSION = '1.01'; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
# Because delegation doesn't get attributes |
12
|
|
|
|
|
|
|
sub BUILD |
13
|
|
|
|
|
|
|
{ |
14
|
5
|
|
|
5
|
1
|
17803
|
my ($self, $argref) = @_; |
15
|
|
|
|
|
|
|
|
16
|
5
|
|
|
|
|
121
|
$self->object->$_( $argref->{$_} ) for keys %$argref; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub internal_attributes |
21
|
|
|
|
|
|
|
{ |
22
|
28
|
|
|
28
|
1
|
112
|
my ($class, $meta) = @_; |
23
|
|
|
|
|
|
|
|
24
|
28
|
|
|
|
|
231
|
map { $_, $_ } $class->attribute_list( $meta ); |
|
466
|
|
|
|
|
1012
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub attribute_list |
29
|
|
|
|
|
|
|
{ |
30
|
30
|
|
|
30
|
1
|
105
|
my ($class, $meta) = @_; |
31
|
|
|
|
|
|
|
|
32
|
10
|
|
|
10
|
|
3452
|
no strict 'refs'; |
|
10
|
|
|
|
|
27
|
|
|
10
|
|
|
|
|
1150
|
|
33
|
30
|
100
|
|
|
|
135
|
ref $class and $class = ref $class; |
34
|
30
|
|
|
|
|
77
|
my $array = '@ATTRS'; |
35
|
30
|
|
|
|
|
363
|
my $stash = Package::Stash->new( $class ); |
36
|
30
|
100
|
|
|
|
309
|
$stash->has_symbol( $array ) and return @{ $stash->get_symbol( $array ) }; |
|
2
|
|
|
|
|
240
|
|
37
|
28
|
|
|
|
|
166
|
my @attrs = grep { $_ ne 'meta' } $meta->get_attribute_list; |
|
476
|
|
|
|
|
1244
|
|
38
|
28
|
|
|
|
|
236
|
$stash->add_symbol( $array, \@attrs ); |
39
|
28
|
|
|
|
|
165
|
@attrs; |
40
|
|
|
|
|
|
|
} |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
10
|
|
|
10
|
|
445653
|
method delete ( App::Toodledo $todo! ) { |
44
|
|
|
|
|
|
|
my $id = $self->id; |
45
|
|
|
|
|
|
|
(my $type = lc ref $self) =~ s/.*://; |
46
|
|
|
|
|
|
|
my $deleted_ref = $todo->call_func( $type => delete => { id => $id } ); |
47
|
|
|
|
|
|
|
$deleted_ref->[0]{id} == $id or $self->log->logdie("Did not get ID back from delete"); |
48
|
|
|
|
|
|
|
} |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
1; |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
__END__ |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 NAME |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 SYNOPSIS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
=head1 DESCRIPTION |
60
|
|
|
|
|
|
|
|
61
|
|
|
|
|
|
|
=head1 METHODS |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
=head2 BUILD |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head2 attribute_list |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
=head2 internal_attributes |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head2 delete |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
=head1 AUTHOR |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
Peter Scott C<cpan at psdt.com> |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=cut |