Karabiner/Manipulator/Conditions/Input_source_if.pm untested

filter: Statementstmt 0.0% 0 / 28 Branchbran 0.0% 0 / 2 Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 2 totaltotal 0.0% 0 / 42 CC 2 SCAR 11.0
CC
2
Cov
0%
add_input_source
6.0
new
2.0
BEGIN
2.0
CRAP 3.0
1 package JSON::Karabiner::Manipulator::Conditions::Input_source_if ;
2 $JSON::Karabiner::Manipulator::Conditions::Input_source_if::VERSION = '0.018';
3 use strict;
4 use warnings;
5 use JSON;
6 use Carp;
7 use parent 'JSON::Karabiner::Manipulator::Conditions::Device_if';
8  
9 sub new {
10 my $class = shift;
11 my ($type, $value) = @_;
12 my $obj = $class->SUPER::new($type, $value);
13 $obj->{data}{input_sources} = $value || [],
14 return $obj;
15 }
16  
17 sub add_input_source {
18 my $s = shift;
19 my @values = @_;
20 croak 'A value for the input_source name is required' unless @values;
21 my $hash = { @values };
22 #TODO: Validates keys
23 push @{$s->{data}{input_sources}}, $hash;
24  
25 }
26  
27 # ABSTRACT: definition for Frontmost_application_if condition
28  
29 1;
30  
31 __END__