| 1 | package WWW::Google::Contacts::Type::PostalAddress; | ||||||||||
| 2 | { | ||||||||||
| 3 | 19 | $WWW::Google::Contacts::Type::PostalAddress::VERSION = '0.39'; | |||||||||
| 4 | } | ||||||||||
| 5 | |||||||||||
| 6 | 19 | ▶ | use Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | 19 | ▶ | use MooseX::Types::Moose qw( Str ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 19 | ▶ | use WWW::Google::Contacts::InternalTypes qw( Rel XmlBool Country ); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 19 | ▶ | use WWW::Google::Contacts::Meta::Attribute::Trait::XmlField; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 19 | extends 'WWW::Google::Contacts::Type::Base'; | |||||||||
| 12 | |||||||||||
| 13 | 19 | with 'WWW::Google::Contacts::Roles::HasTypeAndLabel' => { | |||||||||
| 14 | valid_types => [qw( home work other )], | ||||||||||
| 15 | default_type => 'home', | ||||||||||
| 16 | }; | ||||||||||
| 17 | |||||||||||
| 18 | 19 | has mail_class => ( | |||||||||
| 19 | isa => Rel, | ||||||||||
| 20 | is => 'rw', | ||||||||||
| 21 | traits => ['XmlField'], | ||||||||||
| 22 | xml_key => 'mailClass', | ||||||||||
| 23 | predicate => 'has_mail_class', | ||||||||||
| 24 | coerce => 1, | ||||||||||
| 25 | ); | ||||||||||
| 26 | |||||||||||
| 27 | 19 | has usage => ( | |||||||||
| 28 | isa => Rel, | ||||||||||
| 29 | is => 'rw', | ||||||||||
| 30 | traits => ['XmlField'], | ||||||||||
| 31 | xml_key => 'usage', | ||||||||||
| 32 | predicate => 'has_usage', | ||||||||||
| 33 | coerce => 1, | ||||||||||
| 34 | ); | ||||||||||
| 35 | |||||||||||
| 36 | has primary => ( | ||||||||||
| 37 | isa => XmlBool, | ||||||||||
| 38 | is => 'rw', | ||||||||||
| 39 | traits => ['XmlField'], | ||||||||||
| 40 | predicate => 'has_primary', | ||||||||||
| 41 | xml_key => 'primary', | ||||||||||
| 42 | to_xml => | ||||||||||
| 43 | 0 | ▶ | sub { my $val = shift; return "true" if $val == 1; return "false" }, | ||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
Branch: 1 branch
| |||||||||||
| 44 | 0 | ▶ | default => sub { 0 }, | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 45 | 19 | coerce => 1, | |||||||||
| 46 | ); | ||||||||||
| 47 | |||||||||||
| 48 | 19 | has agent => ( | |||||||||
| 49 | isa => Str, | ||||||||||
| 50 | is => 'rw', | ||||||||||
| 51 | traits => ['XmlField'], | ||||||||||
| 52 | xml_key => 'gd:agent', | ||||||||||
| 53 | predicate => 'has_agent', | ||||||||||
| 54 | is_element => 1, | ||||||||||
| 55 | ); | ||||||||||
| 56 | |||||||||||
| 57 | 19 | has house_name => ( | |||||||||
| 58 | isa => Str, | ||||||||||
| 59 | is => 'rw', | ||||||||||
| 60 | traits => ['XmlField'], | ||||||||||
| 61 | xml_key => 'gd:housename', | ||||||||||
| 62 | predicate => 'has_house_name', | ||||||||||
| 63 | is_element => 1, | ||||||||||
| 64 | ); | ||||||||||
| 65 | |||||||||||
| 66 | 19 | has street => ( | |||||||||
| 67 | isa => Str, | ||||||||||
| 68 | is => 'rw', | ||||||||||
| 69 | traits => ['XmlField'], | ||||||||||
| 70 | xml_key => 'gd:street', | ||||||||||
| 71 | predicate => 'has_street', | ||||||||||
| 72 | is_element => 1, | ||||||||||
| 73 | ); | ||||||||||
| 74 | |||||||||||
| 75 | 19 | has pobox => ( | |||||||||
| 76 | isa => Str, | ||||||||||
| 77 | is => 'rw', | ||||||||||
| 78 | traits => ['XmlField'], | ||||||||||
| 79 | xml_key => 'gd:pobox', | ||||||||||
| 80 | predicate => 'has_pobox', | ||||||||||
| 81 | is_element => 1, | ||||||||||
| 82 | ); | ||||||||||
| 83 | |||||||||||
| 84 | 19 | has neighborhood => ( | |||||||||
| 85 | isa => Str, | ||||||||||
| 86 | is => 'rw', | ||||||||||
| 87 | traits => ['XmlField'], | ||||||||||
| 88 | xml_key => 'gd:neighborhood', | ||||||||||
| 89 | predicate => 'has_neighborhood', | ||||||||||
| 90 | is_element => 1, | ||||||||||
| 91 | ); | ||||||||||
| 92 | |||||||||||
| 93 | 19 | has city => ( | |||||||||
| 94 | isa => Str, | ||||||||||
| 95 | is => 'rw', | ||||||||||
| 96 | traits => ['XmlField'], | ||||||||||
| 97 | xml_key => 'gd:city', | ||||||||||
| 98 | predicate => 'has_city', | ||||||||||
| 99 | is_element => 1, | ||||||||||
| 100 | ); | ||||||||||
| 101 | |||||||||||
| 102 | 19 | has subregion => ( | |||||||||
| 103 | isa => Str, | ||||||||||
| 104 | is => 'rw', | ||||||||||
| 105 | traits => ['XmlField'], | ||||||||||
| 106 | xml_key => 'gd:subregion', | ||||||||||
| 107 | predicate => 'has_subregion', | ||||||||||
| 108 | is_element => 1, | ||||||||||
| 109 | ); | ||||||||||
| 110 | |||||||||||
| 111 | 19 | has region => ( | |||||||||
| 112 | isa => Str, | ||||||||||
| 113 | is => 'rw', | ||||||||||
| 114 | traits => ['XmlField'], | ||||||||||
| 115 | xml_key => 'gd:region', | ||||||||||
| 116 | predicate => 'has_region', | ||||||||||
| 117 | is_element => 1, | ||||||||||
| 118 | ); | ||||||||||
| 119 | |||||||||||
| 120 | 19 | has postcode => ( | |||||||||
| 121 | isa => Str, | ||||||||||
| 122 | is => 'rw', | ||||||||||
| 123 | traits => ['XmlField'], | ||||||||||
| 124 | xml_key => 'gd:postcode', | ||||||||||
| 125 | predicate => 'has_postcode', | ||||||||||
| 126 | is_element => 1, | ||||||||||
| 127 | ); | ||||||||||
| 128 | |||||||||||
| 129 | 19 | has country => ( | |||||||||
| 130 | isa => Country, | ||||||||||
| 131 | is => 'rw', | ||||||||||
| 132 | traits => ['XmlField'], | ||||||||||
| 133 | xml_key => 'gd:country', | ||||||||||
| 134 | predicate => 'has_country', | ||||||||||
| 135 | coerce => 1, | ||||||||||
| 136 | is_element => 1, | ||||||||||
| 137 | ); | ||||||||||
| 138 | |||||||||||
| 139 | 19 | has formatted => ( | |||||||||
| 140 | isa => Str, | ||||||||||
| 141 | is => 'rw', | ||||||||||
| 142 | traits => ['XmlField'], | ||||||||||
| 143 | xml_key => 'gd:formattedAddress', | ||||||||||
| 144 | predicate => 'has_formatted', | ||||||||||
| 145 | is_element => 1, | ||||||||||
| 146 | ); | ||||||||||
| 147 | |||||||||||
| 148 | 19 | ▶ | no Moose; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 149 | 19 | __PACKAGE__->meta->make_immutable; | |||||||||
| 150 | 19 | 1; | |||||||||
| 151 | __END__ | ||||||||||