File Coverage

blib/lib/MoobX/Hash.pm
Criterion Covered Total %
statement 12 15 80.0
branch 0 2 0.0
condition n/a
subroutine 5 6 83.3
pod 0 1 0.0
total 17 24 70.8


line stmt bran cond sub pod time code
1             our $AUTHORITY = 'cpan:YANICK';
2             # ABSTRACT: MoobX wrapper for hash variables
3             $MoobX::Hash::VERSION = '0.1.2';
4              
5             use Moose;
6 3     3   1813  
  3         6  
  3         23  
7             use experimental 'postderef';
8 3     3   18814  
  3         4  
  3         42  
9             has value => (
10             traits => [ 'Hash' ],
11             is => 'rw',
12             default => sub { +{} },
13             handles => {
14             FETCH => 'get',
15             STORE => 'set',
16             CLEAR => 'clear',
17             DELETE => 'delete',
18             EXISTS => 'exists',
19             },
20             );
21              
22             my( $class, @args ) = @_;
23              
24 0     0 0 0 unshift @args, 'value' if @args == 1;
25              
26 0 0       0 return { @args }
27             }
28 0         0  
29             (shift)->new( value => +{ @_ } )
30             }
31              
32 5     5   39  
33              
34              
35 11     11   58 1;
  11         253  
  11         202  
36 11     11   41  
  11         217  
37              
38             =pod
39              
40             =encoding UTF-8
41              
42             =head1 NAME
43              
44             MoobX::Hash - MoobX wrapper for hash variables
45              
46             =head1 VERSION
47              
48             version 0.1.2
49              
50             =head1 DESCRIPTION
51              
52             Class implementing a C<tie>ing interface for hash variables.
53              
54             Used internally by L<MoobX>.
55              
56             =head1 AUTHOR
57              
58             Yanick Champoux <yanick@cpan.org>
59              
60             =head1 COPYRIGHT AND LICENSE
61              
62             This software is copyright (c) 2022, 2017 by Yanick Champoux.
63              
64             This is free software; you can redistribute it and/or modify it under
65             the same terms as the Perl 5 programming language system itself.
66              
67             =cut