File Coverage

blib/lib/Pad/Tie/Plugin/HashRef.pm
Criterion Covered Total %
statement 14 14 100.0
branch n/a
condition n/a
subroutine 5 5 100.0
pod 1 2 50.0
total 20 21 95.2


line stmt bran cond sub pod time code
1 1     1   819 use strict;
  1         2  
  1         30  
2 1     1   5 use warnings;
  1         1  
  1         34  
3              
4             package Pad::Tie::Plugin::HashRef;
5              
6 1     1   4 use base 'Pad::Tie::Plugin';
  1         2  
  1         220  
7              
8 1     1 1 5 sub provides { 'hash_ref' }
9              
10             sub hash_ref {
11 1     1 0 3 my ($plugin, $ctx, $self, $args) = @_;
12              
13 1         6 $args = $plugin->canon_args($args);
14              
15 1         3 for my $method (keys %$args) {
16             # no tie needed because it is a basic hashref
17 1         6 $ctx->{'%' . $args->{$method}} = $self->$method;
18             }
19             }
20              
21             1;
22