Karabiner/Manipulator/Conditions/Keyboard_type_if.pm untested

filter: Statementstmt 0.0% 0 / 39 Branchbran 0.0% 0 / 4 Conditioncond 0.0% 0 / 2 MC/DCmcdc n/a Subroutinesub 0.0% 0 / 10 Podpod 0.0% 0 / 4 totaltotal 0.0% 0 / 59 CC 3 SCAR 12.0
CC
3
Cov
0%
add_keyboard_types
6.0
add_description
6.0
new
2.0
CRAP 3.3
1 package JSON::Karabiner::Manipulator::Conditions::Keyboard_type_if ;
2 $JSON::Karabiner::Manipulator::Conditions::Keyboard_type_if::VERSION = '0.008';
3 use strict;
4 use warnings;
5 use JSON;
6 use Carp;
7 use parent 'JSON::Karabiner::Manipulator::Conditions';
8  
9 sub new {
10 my $class = shift;
11 my ($type, $value) = @_;
12 my $obj = $class->SUPER::new($type, $value);
13 $obj->{data} = $value || {},
14 return $obj;
15 }
16  
17 sub add_keyboard_types {
18 my $s = shift;
19 my @values = @_;
20 croak 'A list of keyboard types is required' unless @values;
21 $s->{data}{keyboard_types} = \@values ;
22 }
23  
24 sub add_description {
25 my $s = shift;
26 my $desc = shift;
27 croak ('No description passed.') unless $desc;
28 $s->{data}{description} = $desc;
29  
30 }
31  
32 sub TO_JSON {
33 my $obj = shift;
34 use Data::Dumper qw(Dumper);
35 my $name = $obj->{def_name};
36 my $value = $obj->{data};
37 print Dumper $value;
38 my %super_hash = (%$value, type => $name);
39 return { %super_hash };
40  
41 }
42 #ABSTRACT: definition for keyboard_type_if condition
43  
44 1;
45  
46 __END__