line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
5
|
|
|
5
|
|
27
|
use strict; |
|
5
|
|
|
|
|
11
|
|
|
5
|
|
|
|
|
155
|
|
2
|
5
|
|
|
5
|
|
25
|
use warnings; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
274
|
|
3
|
|
|
|
|
|
|
package App::Addex::Entry; |
4
|
|
|
|
|
|
|
# ABSTRACT: an entry in your address book |
5
|
|
|
|
|
|
|
$App::Addex::Entry::VERSION = '0.026'; |
6
|
5
|
|
|
|
|
76
|
use Mixin::ExtraFields::Param -fields => { |
7
|
|
|
|
|
|
|
driver => 'HashGuts', |
8
|
|
|
|
|
|
|
moniker => 'field', |
9
|
|
|
|
|
|
|
id => undef, |
10
|
5
|
|
|
5
|
|
4536
|
}; |
|
5
|
|
|
|
|
101582
|
|
11
|
|
|
|
|
|
|
|
12
|
5
|
|
|
5
|
|
22899
|
use Carp (); |
|
5
|
|
|
|
|
12
|
|
|
5
|
|
|
|
|
911
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
#pod =method new |
15
|
|
|
|
|
|
|
#pod |
16
|
|
|
|
|
|
|
#pod my $entry = App::Addex::Entry->new(\%arg); |
17
|
|
|
|
|
|
|
#pod |
18
|
|
|
|
|
|
|
#pod This method returns an Addex Entry object. |
19
|
|
|
|
|
|
|
#pod |
20
|
|
|
|
|
|
|
#pod Valid parameters (sure to change) are: |
21
|
|
|
|
|
|
|
#pod |
22
|
|
|
|
|
|
|
#pod name - a full name (required) |
23
|
|
|
|
|
|
|
#pod nick - a nickname (optional) |
24
|
|
|
|
|
|
|
#pod emails - an arrayref of email addresses (required) |
25
|
|
|
|
|
|
|
#pod |
26
|
|
|
|
|
|
|
#pod =cut |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
sub new { |
29
|
24
|
|
|
24
|
1
|
49
|
my ($class, $arg) = @_; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# XXX: do some validation -- rjbs, 2007-04-06 |
32
|
24
|
|
|
|
|
107
|
my $self = { |
33
|
|
|
|
|
|
|
name => $arg->{name}, |
34
|
|
|
|
|
|
|
nick => $arg->{nick}, |
35
|
|
|
|
|
|
|
emails => $arg->{emails}, |
36
|
|
|
|
|
|
|
}; |
37
|
|
|
|
|
|
|
|
38
|
24
|
|
|
|
|
61
|
bless $self => $class; |
39
|
|
|
|
|
|
|
|
40
|
24
|
100
|
|
|
|
76
|
$self->field(%{ $arg->{fields} }) if $arg->{fields}; |
|
16
|
|
|
|
|
87
|
|
41
|
|
|
|
|
|
|
|
42
|
24
|
|
|
|
|
883
|
return $self; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
#pod =method name |
46
|
|
|
|
|
|
|
#pod |
47
|
|
|
|
|
|
|
#pod =method nick |
48
|
|
|
|
|
|
|
#pod |
49
|
|
|
|
|
|
|
#pod These methods return the value of the property they name. |
50
|
|
|
|
|
|
|
#pod |
51
|
|
|
|
|
|
|
#pod =cut |
52
|
|
|
|
|
|
|
|
53
|
86
|
|
|
86
|
1
|
243
|
sub name { $_[0]->{name} } |
54
|
6
|
|
|
6
|
1
|
19
|
sub nick { $_[0]->{nick} } |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
#pod =method emails |
57
|
|
|
|
|
|
|
#pod |
58
|
|
|
|
|
|
|
#pod This method returns the entry's email addresses. In scalar context it returns |
59
|
|
|
|
|
|
|
#pod the number of addresses. |
60
|
|
|
|
|
|
|
#pod |
61
|
|
|
|
|
|
|
#pod =cut |
62
|
|
|
|
|
|
|
|
63
|
21
|
|
|
21
|
1
|
62
|
sub emails { @{ $_[0]->{emails} } } |
|
21
|
|
|
|
|
85
|
|
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
#pod =method field |
66
|
|
|
|
|
|
|
#pod |
67
|
|
|
|
|
|
|
#pod my $value = $entry->field($name); |
68
|
|
|
|
|
|
|
#pod |
69
|
|
|
|
|
|
|
#pod $entry->field($name => $value); |
70
|
|
|
|
|
|
|
#pod |
71
|
|
|
|
|
|
|
#pod This method is generated by L<Mixin::ExtraFields::Param|Mixin::ExtraFields::Param>. |
72
|
|
|
|
|
|
|
#pod |
73
|
|
|
|
|
|
|
#pod =cut |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
1; |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
__END__ |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
=pod |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=encoding UTF-8 |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 NAME |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
App::Addex::Entry - an entry in your address book |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 VERSION |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
version 0.026 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 METHODS |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
=head2 new |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
my $entry = App::Addex::Entry->new(\%arg); |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
This method returns an Addex Entry object. |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
Valid parameters (sure to change) are: |
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
name - a full name (required) |
102
|
|
|
|
|
|
|
nick - a nickname (optional) |
103
|
|
|
|
|
|
|
emails - an arrayref of email addresses (required) |
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head2 name |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
=head2 nick |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
These methods return the value of the property they name. |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
=head2 emails |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
This method returns the entry's email addresses. In scalar context it returns |
114
|
|
|
|
|
|
|
the number of addresses. |
115
|
|
|
|
|
|
|
|
116
|
|
|
|
|
|
|
=head2 field |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
my $value = $entry->field($name); |
119
|
|
|
|
|
|
|
|
120
|
|
|
|
|
|
|
$entry->field($name => $value); |
121
|
|
|
|
|
|
|
|
122
|
|
|
|
|
|
|
This method is generated by L<Mixin::ExtraFields::Param|Mixin::ExtraFields::Param>. |
123
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
=head1 AUTHOR |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Ricardo SIGNES <rjbs@cpan.org> |
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
This software is copyright (c) 2006 by Ricardo SIGNES. |
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
133
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=cut |