Contacts/Type/Relation.pm

filter: Statementstmt 100% 27 / 27 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 33 / 33 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Contacts/Type/PhoneNumber.pm ↑ Summary Contacts/Type/Sensitivity.pm »
1 package WWW::Google::Contacts::Type::Relation;
2 {
3 20 $WWW::Google::Contacts::Type::Relation::VERSION = '0.38';
4 }
5  
6 20 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
7 20 ▶use MooseX::Types::Moose qw( Str );
Subroutine BEGIN: called CC=1 SCAR=0.0
8 20 ▶use WWW::Google::Contacts::InternalTypes qw( Rel );
Subroutine BEGIN: called CC=1 SCAR=0.0
9 20 ▶use WWW::Google::Contacts::Meta::Attribute::Trait::XmlField;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 20 extends 'WWW::Google::Contacts::Type::Base';
12  
13 20 with 'WWW::Google::Contacts::Roles::HasTypeAndLabel' => {
14 valid_types => [
15 qw(
16 assistant brother child domestic-partner father friend manager
17 mother parent partner referred-by relative sister spouse
18 )
19 ],
20 default_type => '',
21 };
22  
23 20 has value => (
24 isa => Str,
25 is => 'rw',
26 traits => ['XmlField'],
27 xml_key => 'content',
28 predicate => 'has_value',
29 required => 1,
30 );
31  
32 # 'rel' XML key must not have contain a full url, only the value
33 before to_xml_hashref => sub {
34 3 ▶ my $self = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
35 3 my $type = $self->type->uri;
36 3 $type =~ s{^.*\#}{};
37 3 $self->type->uri($type);
38 20 };
39  
40 20 ▶no Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
41 20 __PACKAGE__->meta->make_immutable;
42 20 1;
43 __END__
« Contacts/Type/PhoneNumber.pm ↑ Summary Contacts/Type/Sensitivity.pm »