line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Karabiner::Manipulator::Conditions ; |
2
|
|
|
|
|
|
|
$JSON::Karabiner::Manipulator::Conditions::VERSION = '0.018'; |
3
|
2
|
|
|
2
|
|
1102
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
85
|
|
4
|
2
|
|
|
2
|
|
11
|
use warnings; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
48
|
|
5
|
2
|
|
|
2
|
|
8
|
use JSON; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
10
|
|
6
|
2
|
|
|
2
|
|
199
|
use Carp; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
202
|
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
7
|
|
|
7
|
0
|
14
|
my $class = shift; |
11
|
7
|
|
|
|
|
11
|
my $type = shift; |
12
|
|
|
|
|
|
|
|
13
|
7
|
|
|
|
|
18
|
my $self = { |
14
|
|
|
|
|
|
|
def_name => $type, |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
}; |
17
|
7
|
|
|
|
|
16
|
bless $self, $class; |
18
|
|
|
|
|
|
|
{ |
19
|
2
|
|
|
2
|
|
14
|
no warnings 'once'; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
337
|
|
|
7
|
|
|
|
|
13
|
|
20
|
7
|
|
|
|
|
11
|
$main::current_condition = $self; |
21
|
|
|
|
|
|
|
} |
22
|
7
|
|
|
|
|
19
|
return $self; |
23
|
|
|
|
|
|
|
} |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub TO_JSON { |
26
|
2
|
|
|
2
|
0
|
6
|
my $obj = shift; |
27
|
2
|
|
|
|
|
4
|
my $name = $obj->{def_name}; |
28
|
2
|
|
|
|
|
2
|
my $value = $obj->{data}; |
29
|
2
|
|
|
|
|
4
|
my @data_hash = @{$obj->{data}}; |
|
2
|
|
|
|
|
5
|
|
30
|
2
|
|
|
|
|
3
|
my %super_hash = (); |
31
|
2
|
|
|
|
|
4
|
foreach my $hash (@data_hash) { |
32
|
4
|
|
|
|
|
42
|
my %hash = %$hash; |
33
|
4
|
|
|
|
|
16
|
%super_hash = (%super_hash, %hash); |
34
|
|
|
|
|
|
|
} |
35
|
2
|
|
|
|
|
7
|
%super_hash = (%super_hash, type => $name); |
36
|
2
|
|
|
|
|
26
|
return { %super_hash }; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
} |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
# ABSTRACT: parent class for condition classes |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
__END__ |