blib/lib/XML/Chain/Element.pm

filter: Statementstmt 100% 31 / 31 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 11 / 11 Podpod 66.6% 2 / 3 totaltotal 97.7% 44 / 45 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« blib/lib/XML/Chain/Selector.pm ↑ Summary
1 package XML::Chain::Element;
2  
3 4 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 4 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 4 ▶use utf8;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 4 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 4 our $VERSION = '0.06';
9  
10 4 ▶use Moose;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 4 ▶use MooseX::Aliases;
Subroutine BEGIN: called CC=1 SCAR=0.0
12 4 ▶use Carp qw(croak);
Subroutine BEGIN: called CC=1 SCAR=0.0
13  
14 4 extends qw(XML::Chain::Selector);
15  
16 4 ▶use overload '""' => \&XML::Chain::Selector::as_string, fallback => 1;
Subroutine BEGIN: called CC=1 SCAR=0.0
17  
18 4 has '_xc_el_data' => (is => 'ro', isa => 'HashRef', required => 1);
19 4 has '_xc' => (is => 'rw', isa => 'XML::Chain', required => 1);
20  
21 5 ▶sub as_xml_libxml {return $_[0]->{_xc_el_data}->{lxml};}
Subroutine as_xml_libxml: called CC=1 SCAR=0.0
Pod documented
22 9 ▶sub name {return $_[0]->{_xc_el_data}->{lxml}->nodeName;}
Subroutine name: called CC=1 SCAR=0.0
Pod documented
23 281 ▶sub current_elements {return [$_[0]->_xc_el_data];}
Subroutine current_elements: called CC=1 SCAR=0.0
Pod undocumented
24  
25 4 1;
26  
27 __END__
28  
29 =encoding utf8
30  
31 =head1 NAME
32  
33 XML::Chain::Element - helper class for XML::Chain representing single element
34  
35 =head1 SYNOPSIS
36  
37 xc('body')->c(h1)->t('title')->root
38  
39 =head1 DESCRIPTION
40  
41 Returned by L<XML::Chain::Selector/single> call.
42  
43 =head1 METHODS
44  
45 =head2 name
46  
47 return element name
48  
49 =head2 as_xml_libxml
50  
51 Returns L<XML::LibXML::Element> object.
52  
53 =head2 XML::Chain::Selector methods
54  
55 All of the L<XML::Chain::Selector> methods works too.
56  
57 =head1 AUTHOR
58  
59 Jozef Kutej
60  
61 =head1 COPYRIGHT & LICENSE
62  
63 Copyright 2017 Jozef Kutej, all rights reserved.
64  
65 This program is free software; you can redistribute it and/or modify it
66 under the same terms as Perl itself.
67  
68 =cut
« blib/lib/XML/Chain/Selector.pm ↑ Summary