File Coverage

blib/lib/XML/SRS/Contact.pm
Criterion Covered Total %
statement 2 4 50.0
branch n/a
condition n/a
subroutine 2 2 100.0
pod n/a
total 4 6 66.6


line stmt bran cond sub pod time code
1              
2             package XML::SRS::Contact;
3             BEGIN {
4 1     1   4421 $XML::SRS::Contact::VERSION = '0.09';
5             }
6              
7 1     1   700 use Moose;
  0            
  0            
8             use PRANG::Graph;
9             use XML::SRS::Contact::Address;
10             use XML::SRS::Contact::PSTN;
11             use XML::SRS::Types;
12              
13             # handles
14             has_attr 'handle_id' =>
15             is => "ro",
16             isa => "XML::SRS::HandleId",
17             xml_name => "HandleId",
18             predicate => "has_handle_id",
19             ;
20              
21             has_attr 'action_id' =>
22             is => "rw",
23             isa => "XML::SRS::UID",
24             xml_name => 'ActionId',
25             xml_required => 0,
26             predicate => "has_action_id",
27             ;
28              
29             # attributes
30             has_attr 'name' =>
31             is => "ro",
32             isa => "Str",
33             xml_name => "Name",
34             predicate => "has_name",
35             ;
36              
37             has_attr 'email' =>
38             is => "ro",
39             isa => "XML::SRS::Email",
40             xml_name => "Email",
41             predicate => "has_email",
42             ;
43              
44             # elements
45             has_element 'address' =>
46             is => "ro",
47             isa => "XML::SRS::Contact::Address",
48             xml_nodeName => "PostalAddress",
49             predicate => "has_address",
50             coerce => 1,
51             xml_required => 0,
52             ;
53              
54             has_element 'phone' =>
55             is => "ro",
56             isa => "XML::SRS::Contact::PSTN",
57             predicate => "has_phone",
58             xml_nodeName => "Phone",
59             coerce => 1,
60             xml_required => 0,
61             ;
62              
63             has_element 'fax' =>
64             is => "ro",
65             isa => "XML::SRS::Contact::PSTN",
66             predicate => "has_fax",
67             xml_nodeName => "Fax",
68             coerce => 1,
69             xml_required => 0,
70             ;
71              
72             with 'XML::SRS::Node';
73              
74             use Moose::Util::TypeConstraints;
75             coerce __PACKAGE__
76             => from "HashRef"
77             => via { __PACKAGE__->new(%$_); };
78            
79             1;
80              
81             __END__
82              
83             =head1 NAME
84              
85             XML::SRS::Contact - Class representing an SRS Contact object
86              
87             =head1 DESCRIPTION
88              
89             This class represents an SRS Contact object.
90              
91             =head1 ATTRIBUTES
92              
93             Each attribute of this class has an accessor/mutator of the same name as
94             the attribute. Additionally, they can be passed as parameters to the
95             constructor.
96              
97             =head2 email
98              
99             Must be of type XML::SRS::Email. Maps to the XML attribute 'Email'
100              
101             =head2 handle_id
102              
103             Must be of type XML::SRS::HandleId. Maps to the XML attribute 'HandleId'
104              
105             =head2 fax
106              
107             Must be of type XML::SRS::Contact::PSTN. Maps to the XML element 'Fax'
108              
109             =head2 name
110              
111             Must be of type Str. Maps to the XML attribute 'Name'
112              
113             =head2 address
114              
115             Must be of type XML::SRS::Contact::Address. Maps to the XML element 'PostalAddress'
116              
117             =head2 action_id
118              
119             Must be of type XML::SRS::UID. Maps to the XML attribute 'ActionId'
120              
121             =head2 phone
122              
123             Must be of type XML::SRS::Contact::PSTN. Maps to the XML element 'Phone'
124              
125             =head1 METHODS
126              
127             =head2 new(%params)
128              
129             Construct a new XML::SRS::Request object. %params specifies the initial
130             values of the attributes.
131            
132             =head1 COMPOSED OF
133              
134             L<XML::SRS::Node>
135              
136