File Coverage

blib/lib/WWW/Google/Contacts/Meta/Attribute/Trait/XmlField.pm
Criterion Covered Total %
statement 13 13 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod n/a
total 18 18 100.0


line stmt bran cond sub pod time code
1             package WWW::Google::Contacts::Meta::Attribute::Trait::XmlField;
2             {
3             $WWW::Google::Contacts::Meta::Attribute::Trait::XmlField::VERSION = '0.39';
4             }
5              
6 20     20   15043 use Moose::Role;
  20         96450  
  20         94  
7 20     20   111686 use WWW::Google::Contacts::InternalTypes qw( Method );
  20         43  
  20         196  
8 20     20   50379 use MooseX::Types::Moose qw( Str CodeRef Bool );
  20         44  
  20         163  
9              
10             has xml_key => (
11             isa => Str,
12             is => 'ro',
13             required => 1,
14             );
15              
16             # Allow attributes to have custom code for transforming to xml
17             has to_xml => (
18             isa => CodeRef,
19             is => 'ro',
20             predicate => 'has_to_xml',
21             );
22              
23             has is_element => (
24             isa => Bool,
25             is => 'ro',
26             default => sub { 0 },
27             );
28              
29             has include_in_xml => (
30             isa => Method,
31             is => 'ro',
32             default => sub {
33             sub { 1 }
34             },
35             coerce => 1,
36             );
37              
38 20     20   112579 no Moose::Role;
  20         42  
  20         112  
39              
40             package Moose::Meta::Attribute::Custom::Trait::XmlField;
41             {
42             $Moose::Meta::Attribute::Custom::Trait::XmlField::VERSION = '0.39';
43             }
44              
45             sub register_implementation {
46 20     20   17710 'WWW::Google::Contacts::Meta::Attribute::Trait::XmlField';
47             }
48              
49             1;