File Coverage

blib/lib/Data/Context/BEM/Instance.pm
Criterion Covered Total %
statement 27 29 93.1
branch n/a
condition n/a
subroutine 9 10 90.0
pod n/a
total 36 39 92.3


line stmt bran cond sub pod time code
1             package Data::Context::BEM::Instance;
2              
3             # Created on: 2013-11-06 17:57:39
4             # Create by: Ivan Wills
5             # $Id$
6             # $Revision$, $HeadURL$, $Date$
7             # $Revision$, $Source$, $Date$
8              
9 1     1   5 use Moose;
  1         2  
  1         10  
10 1     1   6153 use namespace::autoclean;
  1         3  
  1         12  
11 1     1   84 use version;
  1         1  
  1         8  
12 1     1   68 use Carp;
  1         1  
  1         64  
13 1     1   4 use Scalar::Util;
  1         2  
  1         47  
14 1     1   4 use List::Util;
  1         1  
  1         54  
15             #use List::MoreUtils;
16 1     1   4 use Data::Dumper qw/Dumper/;
  1         1  
  1         38  
17 1     1   3 use English qw/ -no_match_vars /;
  1         4  
  1         7  
18 1     1   958 use Data::Context::BEM::Merge;
  1         5  
  1         368  
19              
20             extends 'Data::Context::Instance';
21              
22             our $VERSION = version->new('0.0.6');
23              
24             has blocks => (
25             is => 'rw',
26             isa => 'HashRef',
27             default => sub {{}},
28             );
29              
30             around process_data => sub {
31             my ( $orig, $self, $count, $data, $path ) = @_;
32              
33             if ( ref $data eq 'HASH' && $data->{block} ) {
34             my $module = $self->dc->block_module($data->{block});
35             $self->blocks->{$data->{block}} = $module;
36             if ( $module ) {
37             $data->{MODULE} = $module;
38             }
39             $data->{processed} = 1;
40             }
41              
42             return $orig->($count, $data, $path);
43             };
44              
45             sub _merger {
46 0     0     my ($self) = @_;
47              
48 0           return Data::Context::BEM::Merge->new();
49             }
50              
51             __PACKAGE__->meta->make_immutable;
52              
53             1;
54              
55             __END__
56              
57             =head1 NAME
58              
59             Data::Context::BEM::Instance - An instance of a BEM script
60              
61             =head1 VERSION
62              
63             This documentation refers to Data::Context::BEM::Instance version 0.0.6
64              
65             =head1 SYNOPSIS
66              
67             use Data::Context::BEM::Instance;
68              
69             # Brief but working code example(s) here showing the most common usage(s)
70             # This section will be as far as many users bother reading, so make it as
71             # educational and exemplary as possible.
72              
73             =head1 DESCRIPTION
74              
75             =head1 SUBROUTINES/METHODS
76              
77             =head1 DIAGNOSTICS
78              
79             =head1 CONFIGURATION AND ENVIRONMENT
80              
81             =head1 DEPENDENCIES
82              
83             =head1 INCOMPATIBILITIES
84              
85             =head1 BUGS AND LIMITATIONS
86              
87             There are no known bugs in this module.
88              
89             Please report problems to Ivan Wills (ivan.wills@gmail.com).
90              
91             Patches are welcome.
92              
93             =head1 AUTHOR
94              
95             Ivan Wills - (ivan.wills@gmail.com)
96              
97             =head1 LICENSE AND COPYRIGHT
98              
99             Copyright (c) 2013 Ivan Wills (14 Mullion Close, Hornsby Heights, NSW Australia 2077).
100             All rights reserved.
101              
102             This module is free software; you can redistribute it and/or modify it under
103             the same terms as Perl itself. See L<perlartistic>. This program is
104             distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
105             without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
106             PARTICULAR PURPOSE.
107              
108             =cut