File Coverage

blib/lib/WWW/Google/Contacts/Type/Email.pm
Criterion Covered Total %
statement 15 15 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 20 20 100.0


line stmt bran cond sub pod time code
1             package WWW::Google::Contacts::Type::Email;
2             {
3             $WWW::Google::Contacts::Type::Email::VERSION = '0.39';
4             }
5              
6 19     19   111 use Moose;
  19         39  
  19         186  
7 19     19   128078 use MooseX::Types::Moose qw( Str Undef );
  19         44  
  19         235  
8 19     19   105355 use WWW::Google::Contacts::InternalTypes qw( Rel XmlBool );
  19         46  
  19         167  
9 19     19   51907 use WWW::Google::Contacts::Meta::Attribute::Trait::XmlField;
  19         44  
  19         3537  
10              
11             extends 'WWW::Google::Contacts::Type::Base';
12              
13             with 'WWW::Google::Contacts::Roles::HasTypeAndLabel' => {
14             valid_types => [qw( work home other )],
15             default_type => 'work',
16             };
17              
18             has value => (
19             isa => Str,
20             is => 'rw',
21             traits => ['XmlField'],
22             xml_key => 'address',
23             predicate => 'has_value',
24             required => 1,
25             );
26              
27             has display_name => (
28             isa => Str,
29             is => 'rw',
30             traits => ['XmlField'],
31             xml_key => 'displayName',
32             predicate => 'has_display_name',
33             );
34              
35             has primary => (
36             isa => XmlBool,
37             is => 'rw',
38             traits => ['XmlField'],
39             predicate => 'has_primary',
40             xml_key => 'primary',
41             to_xml =>
42             sub { my $val = shift; return "true" if $val == 1; return "false" },
43             default => sub { 0 },
44             coerce => 1,
45             );
46              
47 19     19   112 no Moose;
  19         39  
  19         123  
48             __PACKAGE__->meta->make_immutable;
49             1;
50             __END__