Karabiner/Manipulator/Conditions.pm untested

filter: Statementstmt 0.0% 0 / 34 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 43 CC 1 SCAR 6.9
CC
1
Cov
0%
new
2.0
TO_JSON
2.0
BEGIN
2.0
CRAP 2.0
1 package JSON::Karabiner::Manipulator::Conditions ;
2 $JSON::Karabiner::Manipulator::Conditions::VERSION = '0.008';
3 use strict;
4 use warnings;
5 use JSON;
6 use Carp;
7  
8  
9 sub new {
10 my $class = shift;
11 my $type = shift;
12  
13 my $self = {
14 def_name => $type,
15  
16 };
17 bless $self, $class;
18 return $self;
19 }
20  
21 sub TO_JSON {
22 my $obj = shift;
23 use Data::Dumper qw(Dumper);
24 my $name = $obj->{def_name};
25 my $value = $obj->{data};
26 my @data_hash = @{$obj->{data}};
27 my %super_hash = ();
28 foreach my $hash (@data_hash) {
29 my %hash = %$hash;
30 %super_hash = (%super_hash, %hash);
31 }
32 %super_hash = (%super_hash, type => $name);
33 return { %super_hash };
34  
35 }
36  
37 # ABSTRACT: turns baubles into trinkets
38  
39 1;
40  
41 __END__