| 1 | 5 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 5 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | package App::Addex::AddressBook 0.027; | ||||||||||
| 4 | # ABSTRACT: the address book that addex will consult | ||||||||||
| 5 | |||||||||||
| 6 | 5 | ▶ | use App::Addex::Entry; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 5 | ▶ | use Carp (); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | |||||||||||
| 10 | #pod =method new | ||||||||||
| 11 | #pod | ||||||||||
| 12 | #pod my $addr_book = App::Addex::AddressBook->new(\%arg); | ||||||||||
| 13 | #pod | ||||||||||
| 14 | #pod This method returns a new AddressBook. Its implementation details are left up | ||||||||||
| 15 | #pod to the subclasses, but it must accept a hashref as its first argument. | ||||||||||
| 16 | #pod | ||||||||||
| 17 | #pod Valid arguments are: | ||||||||||
| 18 | #pod | ||||||||||
| 19 | #pod addex - required; the App::Addex object using this address book | ||||||||||
| 20 | #pod | ||||||||||
| 21 | #pod =cut | ||||||||||
| 22 | |||||||||||
| 23 | 6 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=7.1
Pod
documented
| |||||||||||
| 24 | 6 | my ($class, $arg) = @_; | |||||||||
| 25 | 6 | ▶ | Carp::croak "no addex argument provided" unless $arg->{addex}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 26 | 6 | bless { addex => $arg->{addex} } => $class; | |||||||||
| 27 | } | ||||||||||
| 28 | |||||||||||
| 29 | #pod =method addex | ||||||||||
| 30 | #pod | ||||||||||
| 31 | #pod my $addex = $addr_book->addex; | ||||||||||
| 32 | #pod | ||||||||||
| 33 | #pod This returns the App::Addex object with which the address book is associated. | ||||||||||
| 34 | #pod | ||||||||||
| 35 | #pod =cut | ||||||||||
| 36 | |||||||||||
| 37 | 0 | ▶ | sub addex { $_[0]->{addex} } | ||||||||
|
Subroutine
addex: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | |||||||||||
| 39 | #pod =method entries | ||||||||||
| 40 | #pod | ||||||||||
| 41 | #pod my @entries = $addex->entries; | ||||||||||
| 42 | #pod | ||||||||||
| 43 | #pod This method returns the entries in the address book as L<App::Addex::Entry> | ||||||||||
| 44 | #pod objects. Its behavior in scalar context is not yet defined. | ||||||||||
| 45 | #pod | ||||||||||
| 46 | #pod This method should be implemented by a address-book-implementation-specific | ||||||||||
| 47 | #pod subclass. | ||||||||||
| 48 | #pod | ||||||||||
| 49 | #pod =cut | ||||||||||
| 50 | |||||||||||
| 51 | 1 | ▶ | sub entries { | ||||||||
|
Subroutine
entries: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 52 | 1 | Carp::confess "no behavior defined for virtual method entries"; | |||||||||
| 53 | } | ||||||||||
| 54 | |||||||||||
| 55 | 5 | 1; | |||||||||
| 56 | |||||||||||
| 57 | __END__ | ||||||||||