File Coverage

blib/lib/Data/Context/BEM/Instance.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


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   1331 use Moose;
  0            
  0            
10             use namespace::autoclean;
11             use version;
12             use Carp;
13             use Scalar::Util;
14             use List::Util;
15             #use List::MoreUtils;
16             use Data::Dumper qw/Dumper/;
17             use English qw/ -no_match_vars /;
18             use Data::Context::BEM::Merge;
19              
20             extends 'Data::Context::Instance';
21              
22             our $VERSION = version->new('0.0.3');
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             my ($self) = @_;
47              
48             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.3
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