Rabbit/Node.pm

filter: Statementstmt 100% 34 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 10 / 10 Podpod n/a totaltotal 100% 44 / 44 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Rabbit/Role/Node.pm ↑ Summary
1 13 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2 13 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3  
4 package XML::Rabbit::Node;
5 {
6 13 $XML::Rabbit::Node::VERSION = '0.4.0';
7 }
8 13 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 # ABSTRACT: Node base class
11  
12 # Preload XPath attribute traits
13 13 ▶use XML::Rabbit::Trait::XPathValue;
Subroutine BEGIN: called CC=1 SCAR=0.0
14 13 ▶use XML::Rabbit::Trait::XPathValueList;
Subroutine BEGIN: called CC=1 SCAR=0.0
15 13 ▶use XML::Rabbit::Trait::XPathValueMap;
Subroutine BEGIN: called CC=1 SCAR=0.0
16 13 ▶use XML::Rabbit::Trait::XPathObject;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 13 ▶use XML::Rabbit::Trait::XPathObjectList;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 13 ▶use XML::Rabbit::Trait::XPathObjectMap;
Subroutine BEGIN: called CC=1 SCAR=0.0
19  
20  
21 13 with 'XML::Rabbit::Role::Node' => {
22 'node' => { required => 1 },
23 'xpc' => { required => 1 },
24 'namespace_map' => { required => 1 },
25 };
26  
27 13 ▶no Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
28  
29 13 1;
30  
31 __END__
32  
33 =pod
34  
35 =encoding utf-8
36  
37 =head1 NAME
38  
39 XML::Rabbit::Node - Node base class
40  
41 =head1 VERSION
42  
43 version 0.4.0
44  
45 =head1 SYNOPSIS
46  
47 package MyXMLSyntaxNode;
48 use Moose;
49 with 'XML::Rabbit::Node';
50  
51 has title => (
52 isa => 'Str',
53 traits => [qw(XPathValue)],
54 xpath_query => './@title',
55 );
56  
57 no Moose;
58 __PACKAGE__->meta->make_immutable();
59  
60 1;
61  
62 =head1 DESCRIPTION
63  
64 This module provides the base node attribute used to hold a specific node in the XML document tree.
65  
66 See L<XML::Rabbit> for a more complete example.
67  
68 =head1 ATTRIBUTES
69  
70 =head2 node
71  
72 An instance of a L<XML::LibXML::Node> class representing a node in an XML document tree. Read Only.
73  
74 =head2 xpc
75  
76 An instance of a L<XML::LibXML::XPathContext> class initialized with the C<node> attribute. Read Only.
77  
78 =head1 AUTHOR
79  
80 Robin Smidsrød <robin@smidsrod.no>
81  
82 =head1 COPYRIGHT AND LICENSE
83  
84 This software is copyright (c) 2013 by Robin Smidsrød.
85  
86 This is free software; you can redistribute it and/or modify it under
87 the same terms as the Perl 5 programming language system itself.
88  
89 =cut
« Rabbit/Role/Node.pm ↑ Summary