lib/HTML/FormFu/Role/Element/NonBlock.pm

filter: Statementstmt 100% 25 / 25 Branchbran 50.0% 2 / 4 Conditioncond 50.0% 1 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 87.1% 34 / 39 SCAR 13.9
CC
4
Cov
90%
string
3.1
__ANON__
2.0
BEGIN
1.0
CRAP 4.0
« lib/HTML/FormFu/Filter/CompoundJoin.pm ↑ Summary lib/HTML/FormFu/Constraint/Number.pm »
1 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
2  
3 package HTML::FormFu::Role::Element::NonBlock;
4 3 $HTML::FormFu::Role::Element::NonBlock::VERSION = '2.06';
5 # ABSTRACT: base class for single-tag elements
6  
7 3 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 3 ▶use HTML::FormFu::Util qw( process_attrs );
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 3 has tag => ( is => 'rw', traits => ['Chained'] );
12  
13 after BUILD => sub {
14 2 ▶ my $self = shift;
Subroutine __ANON__: called CC=1 SCAR=0.0
15  
16 2 $self->filename('non_block');
17  
18 2 return;
19 3 };
20  
21 around render_data_non_recursive => sub {
22 3 ▶ my ( $orig, $self, $args ) = @_;
Subroutine __ANON__: called CC=2 SCAR=7.1
23  
24 3 ▶ my $render = $self->$orig(
Branch: 1 branch
BranchTrueFalseTotal
$args ? : 0 3 3
25 { tag => $self->tag,
26 $args ? %$args : (),
27 } );
28  
29 3 return $render;
30 3 };
31  
32 sub string {
33 3 ▶ my ( $self, $args ) = @_;
Subroutine string: called CC=3 SCAR=11.3
Pod undocumented
34  
35 3 ▶ $args ||= {};
Condition50%1/2
$args ||= {}
l!l
03
MC/DC0%0/1
$args ||= {}
$args
Truth table50%1/2
A
A= $args
Aresult
11
00
36  
37 my $render
38 = exists $args->{render_data}
39 ? $args->{render_data}
40 3 ▶ : $self->render_data;
Branch: 1 branch
BranchTrueFalseTotal
exists $args->{'render_data'} ? : 0 3 3
41  
42 # non_block template
43  
44 my $html = sprintf "<%s%s />",
45 $render->{tag},
46 3 process_attrs( $render->{attributes} ),
47 ;
48  
49 3 return $html;
50 }
51  
52 3 1;
53  
54 __END__
55  
56 =pod
57  
58 =encoding UTF-8
59  
60 =head1 NAME
61  
62 HTML::FormFu::Role::Element::NonBlock - base class for single-tag elements
63  
64 =head1 VERSION
65  
66 version 2.06
67  
68 =head1 DESCRIPTION
69  
70 Base class for single-tag elements.
71  
72 =head1 METHODS
73  
74 =head2 tag
75  
76 =head1 SEE ALSO
77  
78 Is a sub-class of, and inherits methods from L<HTML::FormFu::Element>
79  
80 L<HTML::FormFu>
81  
82 =head1 AUTHOR
83  
84 Carl Franks, C<cfranks@cpan.org>
85  
86 =head1 LICENSE
87  
88 This library is free software, you can redistribute it and/or modify it under
89 the same terms as Perl itself.
90  
91 =head1 AUTHOR
92  
93 Carl Franks <cpan@fireartist.com>
94  
95 =head1 COPYRIGHT AND LICENSE
96  
97 This software is copyright (c) 2018 by Carl Franks.
98  
99 This is free software; you can redistribute it and/or modify it under
100 the same terms as the Perl 5 programming language system itself.
101  
102 =cut
« lib/HTML/FormFu/Filter/CompoundJoin.pm ↑ Summary lib/HTML/FormFu/Constraint/Number.pm »