File Coverage

blib/lib/WWW/Google/Contacts/Type/Organization.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::Organization;
2             {
3             $WWW::Google::Contacts::Type::Organization::VERSION = '0.39';
4             }
5              
6 19     19   119 use Moose;
  19         42  
  19         212  
7 19     19   128964 use MooseX::Types::Moose qw( Str );
  19         49  
  19         290  
8 19     19   100480 use WWW::Google::Contacts::InternalTypes qw( Rel XmlBool Where );
  19         47  
  19         173  
9 19     19   56950 use WWW::Google::Contacts::Meta::Attribute::Trait::XmlField;
  19         45  
  19         5965  
10              
11             extends 'WWW::Google::Contacts::Type::Base';
12              
13             with 'WWW::Google::Contacts::Roles::HasTypeAndLabel' => {
14             valid_types => [qw( work other )],
15             default_type => 'work',
16             };
17              
18             has department => (
19             isa => Str,
20             is => 'rw',
21             traits => ['XmlField'],
22             xml_key => 'gd:orgDepartment',
23             predicate => 'has_department',
24             is_element => 1,
25             );
26              
27             has job_description => (
28             isa => Str,
29             is => 'rw',
30             traits => ['XmlField'],
31             xml_key => 'gd:orgJobDescription',
32             predicate => 'has_job_description',
33             is_element => 1,
34             );
35              
36             has name => (
37             isa => Str,
38             is => 'rw',
39             traits => ['XmlField'],
40             xml_key => 'gd:orgName',
41             predicate => 'has_name',
42             is_element => 1,
43             );
44              
45             has symbol => (
46             isa => Str,
47             is => 'rw',
48             traits => ['XmlField'],
49             xml_key => 'gd:orgSymbol',
50             predicate => 'has_symbol',
51             is_element => 1,
52             );
53              
54             has title => (
55             isa => Str,
56             is => 'rw',
57             traits => ['XmlField'],
58             xml_key => 'gd:orgTitle',
59             predicate => 'has_title',
60             is_element => 1,
61             );
62              
63             has primary => (
64             isa => XmlBool,
65             is => 'rw',
66             traits => ['XmlField'],
67             predicate => 'has_primary',
68             xml_key => 'primary',
69             to_xml =>
70             sub { my $val = shift; return "true" if $val == 1; return "false" },
71             default => sub { 0 },
72             coerce => 1,
73             );
74              
75             has where => (
76             isa => Where,
77             is => 'rw',
78             traits => ['XmlField'],
79             xml_key => 'gd:where',
80             predicate => 'has_where',
81             is_element => 1,
82             coerce => 1,
83             );
84              
85 19     19   114 no Moose;
  19         43  
  19         129  
86             __PACKAGE__->meta->make_immutable;
87             1;
88             __END__