blib/lib/XML/Grammar/Fiction/Struct/Tag.pm

filter: Statementstmt 97.3% 36 / 37 Branchbran 50.0% 1 / 2 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 9 / 9 Podpod 100% 3 / 3 totaltotal 96.0% 49 / 51 CC 2 SCAR 1.9
CC
2
Cov
95%
append_children
2.0
__ANON__
1.0
BEGIN
1.0
CRAP 1.2
« blib/lib/XML/Grammar/Screenplay/API/ImageListDoc.pm ↑ Summary blib/lib/XML/Grammar/Fiction/ToDocBook.pm »
1 package XML::Grammar::Fiction::Struct::Tag;
2 17 $XML::Grammar::Fiction::Struct::Tag::VERSION = '0.22.0';
3 17 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 17 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 17 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 17 ▶use List::MoreUtils ();
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10  
11 17 has 'name' => ( is => "rw", isa => "Str" );
12 17 has 'line' => ( is => "rw", isa => "Int" );
13 17 has 'is_standalone' => ( is => "rw", isa => "Bool" );
14 17 has 'attrs' => ( is => "rw", isa => "ArrayRef" );
15 17 has 'children' => (
16 is => "rw",
17 isa => "Maybe[ArrayRef]",
18 );
19  
20 sub append_children
21 {
22 1305 ▶ my ( $self, $children ) = @_;
Subroutine append_children: called CC=2 SCAR=7.1
Pod documented
23  
24 # This is an assert / sanity check.
25 1305 ▶ if ( List::MoreUtils::any { !defined($_) } @$children )
Subroutine __ANON__: called CC=1 SCAR=0.2
Branch: 1 branch
BranchTrueFalseTotal
if (&List::MoreUtils::any(sub { not defined $_; } , @$children)) 0 1305 1305
26 {
27 0 Carp::confess("append_children with undef.");
28 }
29  
30 1305 push @{ $self->children() }, @$children;
31  
32 1305 return;
33 }
34  
35 sub append_child
36 {
37 1305 ▶ my ( $self, $child ) = @_;
Subroutine append_child: called CC=1 SCAR=0.0
Pod documented
38  
39 1305 return $self->append_children( [$child] );
40 }
41  
42 sub detach_children
43 {
44 792 ▶ my $self = shift;
Subroutine detach_children: called CC=1 SCAR=0.0
Pod documented
45  
46 792 my $children = $self->children();
47  
48 792 $self->children(undef);
49  
50 792 return $children;
51 }
52  
53 package XML::Grammar::Fiction::Struct::Tag::Para;
54 17 $XML::Grammar::Fiction::Struct::Tag::Para::VERSION = '0.22.0';
55 17 ▶use MooX 'late';
Subroutine BEGIN: called CC=1 SCAR=0.0
56  
57 17 extends("XML::Grammar::Fiction::Struct::Tag");
58  
59  
60 17 1;
61  
62 __END__
63  
64 =pod
65  
66 =encoding UTF-8
67  
68 =head1 NAME
69  
70 XML::Grammar::Fiction::Struct::Tag - information about an XML/SGML opening or
71 closing tag.
72  
73 B<For internal use only>.
74  
75 =head1 VERSION
76  
77 version 0.22.0
78  
79 =head1 METHODS
80  
81 =head2 $self->name()
82  
83 The tag's name.
84  
85 =head2 $self->line()
86  
87 The tag's line number.
88  
89 =head2 $self->is_standalone()
90  
91 Determines whether it's a standalone tag or not. (if it's an opening tag).
92  
93 =head2 $self->attrs()
94  
95 The attributes of the opening tag in an array.
96  
97 =head2 $self->children()
98  
99 A placeholder for the element's children.
100  
101 =head2 $self->append_children(\@children)
102  
103 Append more elements to the children.
104  
105 =head2 $self->append_child($child)
106  
107 Appends a single child. Uses C<append_children()> .
108  
109 =head2 my $children = $self->detach_children()
110  
111 Detaches the children and returns them as an array reference.
112  
113 =for :stopwords cpan testmatrix url bugtracker rt cpants kwalitee diff irc mailto metadata placeholders metacpan
114  
115 =head1 SUPPORT
116  
117 =head2 Websites
118  
119 The following websites have more information about this module, and may be of help to you. As always,
120 in addition to those websites please use your favorite search engine to discover more resources.
121  
122 =over 4
123  
124 =item *
125  
126 MetaCPAN
127  
128 A modern, open-source CPAN search engine, useful to view POD in HTML format.
129  
130 L<https://metacpan.org/release/XML-Grammar-Fiction>
131  
132 =item *
133  
134 RT: CPAN's Bug Tracker
135  
136 The RT ( Request Tracker ) website is the default bug/issue tracking system for CPAN.
137  
138 L<https://rt.cpan.org/Public/Dist/Display.html?Name=XML-Grammar-Fiction>
139  
140 =item *
141  
142 CPANTS
143  
144 The CPANTS is a website that analyzes the Kwalitee ( code metrics ) of a distribution.
145  
146 L<http://cpants.cpanauthors.org/dist/XML-Grammar-Fiction>
147  
148 =item *
149  
150 CPAN Testers
151  
152 The CPAN Testers is a network of smoke testers who run automated tests on uploaded CPAN distributions.
153  
154 L<http://www.cpantesters.org/distro/X/XML-Grammar-Fiction>
155  
156 =item *
157  
158 CPAN Testers Matrix
159  
160 The CPAN Testers Matrix is a website that provides a visual overview of the test results for a distribution on various Perls/platforms.
161  
162 L<http://matrix.cpantesters.org/?dist=XML-Grammar-Fiction>
163  
164 =item *
165  
166 CPAN Testers Dependencies
167  
168 The CPAN Testers Dependencies is a website that shows a chart of the test results of all dependencies for a distribution.
169  
170 L<http://deps.cpantesters.org/?module=XML::Grammar::Fiction>
171  
172 =back
173  
174 =head2 Bugs / Feature Requests
175  
176 Please report any bugs or feature requests by email to C<bug-xml-grammar-fiction at rt.cpan.org>, or through
177 the web interface at L<https://rt.cpan.org/Public/Bug/Report.html?Queue=XML-Grammar-Fiction>. You will be automatically notified of any
178 progress on the request by the system.
179  
180 =head2 Source Code
181  
182 The code is open to the world, and available for you to hack on. Please feel free to browse it and play
183 with it, or whatever. If you want to contribute patches, please send me a diff or prod me to pull
184 from your repository :)
185  
186 L<https://github.com/shlomif/fiction-xml>
187  
188 git clone git://github.com/shlomif/fiction-xml.git
189  
190 =head1 AUTHOR
191  
192 Shlomi Fish <shlomif@cpan.org>
193  
194 =head1 BUGS
195  
196 Please report any bugs or feature requests on the bugtracker website
197 L<https://github.com/shlomif/fiction-xml/issues>
198  
199 When submitting a bug or request, please include a test-file or a
200 patch to an existing test-file that illustrates the bug or desired
201 feature.
202  
203 =head1 COPYRIGHT AND LICENSE
204  
205 This software is Copyright (c) 2007 by Shlomi Fish.
206  
207 This is free software, licensed under:
208  
209 The MIT (X11) License
210  
211 =cut
« blib/lib/XML/Grammar/Screenplay/API/ImageListDoc.pm ↑ Summary blib/lib/XML/Grammar/Fiction/ToDocBook.pm »