| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package Net::Amazon::S3::ACL::Grant::Email; | 
| 2 |  |  |  |  |  |  |  | 
| 3 | 1 |  |  | 1 |  | 1547 | use warnings; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 31 |  | 
| 4 | 1 |  |  | 1 |  | 5 | use strict; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 26 |  | 
| 5 | 1 |  |  | 1 |  | 4 | use Carp; | 
|  | 1 |  |  |  |  | 2 |  | 
|  | 1 |  |  |  |  | 66 |  | 
| 6 | 1 |  |  | 1 |  | 5 | use English qw( -no_match_vars ); | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 7 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 | 1 |  |  | 1 |  | 530 | use base qw(Net::Amazon::S3::ACL::Grant); | 
|  | 1 |  |  |  |  | 1 |  | 
|  | 1 |  |  |  |  | 439 |  | 
| 9 |  |  |  |  |  |  | __PACKAGE__->mk_accessors(qw( email )); | 
| 10 |  |  |  |  |  |  |  | 
| 11 |  |  |  |  |  |  | # Module implementation here | 
| 12 |  |  |  |  |  |  | sub parse_grantee { | 
| 13 | 0 |  |  | 0 | 1 |  | my ($self, $xpc, $node) = @_; | 
| 14 |  |  |  |  |  |  |  | 
| 15 | 0 | 0 |  |  |  |  | my $email = $xpc->findvalue('.//s3:Grantee/s3:EmailAddress', $node) | 
| 16 |  |  |  |  |  |  | or croak "no email grant in provided node"; | 
| 17 | 0 |  |  |  |  |  | $self->email($email); | 
| 18 | 0 |  |  |  |  |  | $self->key($email); | 
| 19 |  |  |  |  |  |  |  | 
| 20 | 0 |  |  |  |  |  | return $self; | 
| 21 |  |  |  |  |  |  | } ## end sub _parse_acl_grant | 
| 22 |  |  |  |  |  |  |  | 
| 23 |  |  |  |  |  |  | sub populate_from_target { | 
| 24 | 0 |  |  | 0 | 1 |  | my ($self, $target) = @_; | 
| 25 | 0 | 0 |  |  |  |  | croak "$target is not an email address" unless $target =~ /@/; | 
| 26 | 0 |  |  |  |  |  | $self->email($target); | 
| 27 | 0 |  |  |  |  |  | $self->key($target); | 
| 28 | 0 |  |  |  |  |  | return $self; | 
| 29 |  |  |  |  |  |  | } | 
| 30 |  |  |  |  |  |  |  | 
| 31 | 0 |  |  | 0 |  |  | sub _set_key { $_[0]->key($_[0]->email()); } | 
| 32 |  |  |  |  |  |  |  | 
| 33 |  |  |  |  |  |  | sub stringify_grantee { | 
| 34 | 0 |  |  | 0 | 1 |  | my ($self) = @_; | 
| 35 | 0 |  |  |  |  |  | my $email = $self->email(); | 
| 36 | 0 |  |  |  |  |  | return <<"END_OF_GRANTEE"; | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | $email | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | END_OF_GRANTEE | 
| 41 |  |  |  |  |  |  | } | 
| 42 |  |  |  |  |  |  |  | 
| 43 |  |  |  |  |  |  | 1; # Magic true value required at end of module | 
| 44 |  |  |  |  |  |  | __END__ |