File Coverage

blib/lib/WWW/Google/Contacts/Type/Website.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::Website;
2             {
3             $WWW::Google::Contacts::Type::Website::VERSION = '0.39';
4             }
5              
6 19     19   206 use Moose;
  19         42  
  19         178  
7 19     19   129779 use MooseX::Types::Moose qw( Str );
  19         49  
  19         235  
8 19     19   101521 use WWW::Google::Contacts::InternalTypes qw( Rel XmlBool );
  19         46  
  19         179  
9 19     19   52783 use WWW::Google::Contacts::Meta::Attribute::Trait::XmlField;
  19         47  
  19         4045  
10              
11             extends 'WWW::Google::Contacts::Type::Base';
12              
13             has type => (
14             isa => Str, # not a full url rel :-/
15             is => 'rw',
16             traits => ['XmlField'],
17             xml_key => 'rel',
18             predicate => 'has_type',
19             );
20              
21             has value => (
22             isa => Str,
23             is => 'rw',
24             traits => ['XmlField'],
25             xml_key => 'href',
26             predicate => 'has_value',
27             required => 1,
28             );
29              
30             has label => (
31             isa => Str,
32             is => 'rw',
33             traits => ['XmlField'],
34             xml_key => 'label',
35             predicate => 'has_label',
36             );
37              
38             has primary => (
39             isa => XmlBool,
40             is => 'rw',
41             traits => ['XmlField'],
42             predicate => 'has_primary',
43             xml_key => 'primary',
44             to_xml =>
45             sub { my $val = shift; return "true" if $val == 1; return "false" },
46             default => sub { 0 },
47             coerce => 1,
48             );
49              
50 19     19   135 no Moose;
  19         39  
  19         123  
51             __PACKAGE__->meta->make_immutable;
52             1;
53             __END__