File Coverage

web/cgi-bin/yatt.lib/YATT/LRXML/MetaInfo.pm
Criterion Covered Total %
statement 26 28 92.8
branch 5 6 83.3
condition n/a
subroutine 7 8 87.5
pod 0 2 0.0
total 38 44 86.3


line stmt bran cond sub pod time code
1             # -*- mode: perl; coding: utf-8 -*-
2             package YATT::LRXML::MetaInfo;
3 7     7   36 use strict;
  7         14  
  7         232  
4 7     7   36 use warnings qw(FATAL all NONFATAL misc);
  7         13  
  7         387  
5 7     7   36 use base qw(YATT::Class::Configurable);
  7         13  
  7         695  
6 7     7   39 BEGIN {require Exporter; *import = \&Exporter::import}
  7         872  
7             our @EXPORT = qw(MetaInfo);
8             our @EXPORT_OK = @EXPORT;
9              
10             sub MetaInfo () {__PACKAGE__}
11              
12             use YATT::Fields
13 7     0   88 (['^nsdict' => sub { {} }]
  0         0  
14             , ['cf_namespace' => 'yatt']
15             , [cf_startline => 1]
16             , qw(^=tokens
17             ^cf_filename
18             cf_nsid
19             cf_iolayer
20             ^cf_caller_widget
21             )
22 7     7   39 );
  7         15  
23              
24             sub after_configure {
25 731     731 0 1347 my MY $self = shift;
26 731         2236 $self->SUPER::after_configure;
27 731 50       2563 if (defined $self->{cf_namespace}) {
28 731         1716 my $nsdict = $self->{nsdict} = {};
29             $self->{cf_namespace} = [$self->{cf_namespace}]
30 731 100       2437 unless ref $self->{cf_namespace} eq 'ARRAY';
31 731         1024 foreach my $ns (@{$self->{cf_namespace}}) {
  731         1911  
32 1295         4526 $nsdict->{$ns} = keys %$nsdict;
33             }
34             } else {
35 0         0 $self->{nsdict} = {};
36             }
37             }
38              
39             sub in_file {
40 2     2 0 4 (my MY $self) = @_;
41 2 100       9 if (defined $$self{cf_filename}) {
42 1         11 " in file $$self{cf_filename}";
43             } else {
44 1         10 '';
45             }
46             }
47              
48             1;