File Coverage

blib/lib/Perl6/Pod/Directive/config.pm
Criterion Covered Total %
statement 19 19 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 0 1 0.0
total 24 25 96.0


line stmt bran cond sub pod time code
1             package Perl6::Pod::Directive::config;
2              
3             =pod
4              
5             =head1 NAME
6              
7             Perl6::Pod::Directive::config - handle =config directive
8              
9             =head1 SYNOPSIS
10              
11             Block pre-configuration
12              
13             =config head1 :numbered
14             =config head2 :like :formatted
15              
16             Pre-configuring formatting codes
17              
18              
19             =config V<> :allow
20             =config C<> :formatted
21              
22              
23             =head1 DESCRIPTION
24              
25             Perl6::Pod::Directive::config - handle =config directive
26              
27             The =config directive allows you to prespecify standard configuration information that is applied to every block of a particular type.
28              
29             =config BLOCK_TYPE CONFIG OPTIONS
30             = OPTIONAL EXTRA CONFIG OPTIONS
31              
32             =cut
33              
34 3     3   15 use warnings;
  3         7  
  3         101  
35 3     3   15 use strict;
  3         5  
  3         67  
36 3     3   17 use Perl6::Pod::Block;
  3         15  
  3         88  
37 3     3   21 use base 'Perl6::Pod::Block';
  3         4  
  3         604  
38             our $VERSION = '0.01';
39              
40             sub new {
41 3     3 0 19 my ( $class, %args ) = @_;
42 3         24 my $self = $class->SUPER::new(%args);
43 3         12 my $block_name = $self->{block_name};
44 3         19 my $attr = $self->get_attr;
45 3         11 my $context = $self->context;
46 3         10 $context->config->{$block_name} = $attr;
47 3         90 return undef;
48             }
49             1;
50              
51             __END__