| 1 | 6 | ▶ | use v5.14.0; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 2 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | |||||||||||
| 4 | package OS::Package::Maintainer; | ||||||||||
| 5 | |||||||||||
| 6 | # ABSTRACT: OS::Package::Maintainer object. | ||||||||||
| 7 | 6 | our $VERSION = '0.2.6'; # VERSION | |||||||||
| 8 | |||||||||||
| 9 | 6 | ▶ | use Moo; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 6 | ▶ | use Types::Standard qw( Str Enum ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | |||||||||||
| 12 | 6 | has author => ( is => 'rw', isa => Str, required => 1 ); | |||||||||
| 13 | |||||||||||
| 14 | has company => ( | ||||||||||
| 15 | is => 'rw', | ||||||||||
| 16 | isa => Str, | ||||||||||
| 17 | 0 | ▶ | default => sub { my $self = shift; return $self->author } | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 18 | 6 | ); | |||||||||
| 19 | |||||||||||
| 20 | 6 | has [qw/nickname email phone/] => ( is => 'rw', isa => Str ); | |||||||||
| 21 | |||||||||||
| 22 | sub by_line { | ||||||||||
| 23 | 0 | ▶ | my $self = shift; | ||||||||
|
Subroutine
by_line: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||
| 24 | |||||||||||
| 25 | 0 | my $by_line = $self->author; | |||||||||
| 26 | |||||||||||
| 27 | 0 | ▶ | if ( defined $self->nickname ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 28 | 0 | $by_line .= sprintf ' (%s)', $self->nickname; | |||||||||
| 29 | } | ||||||||||
| 30 | |||||||||||
| 31 | 0 | ▶ | if ( defined $self->email ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 32 | 0 | $by_line .= sprintf ' <%s>', $self->email; | |||||||||
| 33 | } | ||||||||||
| 34 | |||||||||||
| 35 | 0 | ▶ | if ( defined $self->phone ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 36 | 0 | $by_line .= sprintf ' %s', $self->phone; | |||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 0 | return $by_line; | |||||||||
| 40 | |||||||||||
| 41 | } | ||||||||||
| 42 | |||||||||||
| 43 | 6 | 1; | |||||||||
| 44 | |||||||||||
| 45 | __END__ | ||||||||||
| 46 | |||||||||||
| 47 | =pod | ||||||||||
| 48 | |||||||||||
| 49 | =encoding UTF-8 | ||||||||||
| 50 | |||||||||||
| 51 | =head1 NAME | ||||||||||
| 52 | |||||||||||
| 53 | OS::Package::Maintainer - OS::Package::Maintainer object. | ||||||||||
| 54 | |||||||||||
| 55 | =head1 VERSION | ||||||||||
| 56 | |||||||||||
| 57 | version 0.2.6 | ||||||||||
| 58 | |||||||||||
| 59 | =head1 METHODS | ||||||||||
| 60 | |||||||||||
| 61 | =head2 author | ||||||||||
| 62 | |||||||||||
| 63 | Name of the maintainer (required). | ||||||||||
| 64 | |||||||||||
| 65 | =head2 nickname | ||||||||||
| 66 | |||||||||||
| 67 | Nickname of the maintainer. | ||||||||||
| 68 | |||||||||||
| 69 | =head2 email | ||||||||||
| 70 | |||||||||||
| 71 | The email address of the maintainer. | ||||||||||
| 72 | |||||||||||
| 73 | =head2 phone | ||||||||||
| 74 | |||||||||||
| 75 | Phone number of the maintainer. | ||||||||||
| 76 | |||||||||||
| 77 | =head2 company | ||||||||||
| 78 | |||||||||||
| 79 | The company of the maintainer. | ||||||||||
| 80 | |||||||||||
| 81 | =head2 by_line | ||||||||||
| 82 | |||||||||||
| 83 | Returns string "Author (nickname) <email> phone". | ||||||||||
| 84 | |||||||||||
| 85 | =head1 AUTHOR | ||||||||||
| 86 | |||||||||||
| 87 | James F Wilkus <jfwilkus@cpan.org> | ||||||||||
| 88 | |||||||||||
| 89 | =head1 COPYRIGHT AND LICENSE | ||||||||||
| 90 | |||||||||||
| 91 | This software is Copyright (c) 2014 by James F Wilkus. | ||||||||||
| 92 | |||||||||||
| 93 | This is free software, licensed under: | ||||||||||
| 94 | |||||||||||
| 95 | The (three-clause) BSD License | ||||||||||
| 96 | |||||||||||
| 97 | =cut | ||||||||||