FormHandler/Moose/Role.pm

filter: Statementstmt 87.5% 21 / 24 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 85.7% 6 / 7 Podpod 0.0% 0 / 4 totaltotal 77.1% 27 / 35 CC 1 SCAR 1.3
CC
1
Cov
88%
apply
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.1
« FormHandler/Page.pm ↑ Summary FormHandler/Model.pm »
1 package HTML::FormHandler::Moose::Role;
2 # ABSTRACT: to add sugar to roles
3 6 $HTML::FormHandler::Moose::Role::VERSION = '0.410002';
4 6 ▶use Moose::Role;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 6 ▶use Moose::Exporter;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7  
8 6 Moose::Exporter->setup_import_methods(
9 with_caller => [ 'has_field', 'has_block', 'apply' ],
10 also => 'Moose::Role',
11 );
12  
13 9 ▶sub init_meta {
Subroutine init_meta: called CC=1 SCAR=0.0
Pod undocumented
14 9 my $class = shift;
15  
16 9 my %options = @_;
17 9 Moose::Role->init_meta(%options);
18 my $meta = Moose::Util::MetaRole::apply_metaroles(
19 for => $options{for_class},
20 9 role_metaroles => { role => ['HTML::FormHandler::Meta::Role'] }
21 );
22  
23 9 return $meta;
24 }
25  
26 39 ▶sub has_field {
Subroutine has_field: called CC=1 SCAR=0.0
Pod undocumented
27 39 my ( $class, $name, %options ) = @_;
28  
29 39 $class->meta->add_to_field_list( { name => $name, %options } );
30 }
31  
32 3 ▶sub has_block {
Subroutine has_block: called CC=1 SCAR=0.0
Pod undocumented
33 3 my ( $class, $name, %options ) = @_;
34 3 $class->meta->add_to_block_list( { name => $name, %options } );
35 }
36  
37 0 ▶sub apply {
Subroutine apply: not called CC=1 SCAR=6.9
Pod undocumented
38 0 my ( $class, $arrayref ) = @_;
39 0 $class->meta->add_to_apply_list( @{$arrayref} );
40 }
41  
42 6 ▶use namespace::autoclean;
Subroutine BEGIN: called CC=1 SCAR=0.0
43 6 1;
44  
45 __END__
« FormHandler/Page.pm ↑ Summary FormHandler/Model.pm »