EPP/Error.pm

filter: Statementstmt 66.6% 4 / 6 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 2 / 2 Podpod n/a totaltotal 75.0% 6 / 8 CC 1 SCAR 1.4
CC
1
Cov
67%
BEGIN
1.3
BEGIN
1.0
CRAP 1.1
« EPP/Domain/Node.pm ↑ Summary EPP/ExtURI.pm »
1 package XML::EPP::Error;
2  
3 # I've called this class 'error' - extErrValueType is a stupid name.
4  
5 1 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 0 ▶use MooseX::Method::Signatures;
Subroutine BEGIN: called CC=1 SCAR=2.6
7 use Moose::Util::TypeConstraints;
8 use PRANG::Graph;
9  
10 our $SCHEMA_PKG = "XML::EPP";
11  
12 use XML::EPP::Msg;
13 use PRANG::XMLSchema::Whatever;
14  
15 # PRANG::XMLSchema::Whatever means that the object within will
16 # effectively be an unparsed XML fragment
17 subtype "${SCHEMA_PKG}::errValueType"
18 => as "PRANG::XMLSchema::Whatever";
19  
20 with 'XML::EPP::Node';
21  
22 coerce "${SCHEMA_PKG}::errValueType"
23 => from "Str",
24 => via {
25 PRANG::XMLSchema::Whatever->new(
26 contents => [$_],
27 nodenames => [""],
28 );
29 };
30  
31 coerce "${SCHEMA_PKG}::errValueType"
32 => from "XML::LibXML::Element",
33 => via {
34 my $node = $_;
35 my $whatever = PRANG::XMLSchema::Whatever->new(
36 contents => [],
37 nodenames => [$node->localName],
38 nodenames_ns => [$node->namespaceURI],
39 );
40 $whatever->contents->[0] = $node;
41 $whatever;
42 };
43  
44 has_element 'value' =>
45 is => "rw",
46 isa => "${SCHEMA_PKG}::errValueType",
47 coerce => 1,
48 required => 1,
49 xmlns => &xmlns,
50 ;
51  
52 has_element 'reason' =>
53 is => "rw",
54 isa => "${SCHEMA_PKG}::msgType",
55 required => 1,
56 coerce => 1,
57 ;
58  
59 subtype "${SCHEMA_PKG}::extErrValueType"
60 => as __PACKAGE__;
61  
62 1;
« EPP/Domain/Node.pm ↑ Summary EPP/ExtURI.pm »