line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package JSON::Karabiner::Manipulator::Conditions::Event_changed_if ; |
2
|
|
|
|
|
|
|
$JSON::Karabiner::Manipulator::Conditions::Event_changed_if::VERSION = '0.018'; |
3
|
1
|
|
|
1
|
|
6
|
use strict; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
4
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
5
|
use JSON; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
109
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
53
|
|
7
|
1
|
|
|
1
|
|
7
|
use parent 'JSON::Karabiner::Manipulator::Conditions::Variable_if'; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1
|
|
|
1
|
0
|
3
|
my $class = shift; |
11
|
1
|
|
|
|
|
3
|
my ($type, $value) = @_; |
12
|
1
|
|
|
|
|
6
|
my $obj = $class->SUPER::new($type, $value); |
13
|
1
|
|
50
|
|
|
8
|
$obj->{data} = $value || {}, |
14
|
|
|
|
|
|
|
return $obj; |
15
|
|
|
|
|
|
|
} |
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
sub add_value { |
18
|
1
|
|
|
1
|
0
|
342
|
my $s = shift; |
19
|
1
|
|
|
|
|
3
|
my $value = shift; |
20
|
1
|
50
|
|
|
|
6
|
$value = $value eq 'true' ? JSON::true : JSON::false; |
21
|
1
|
50
|
|
|
|
37
|
croak 'A value for the varaible name is required' unless $value; |
22
|
|
|
|
|
|
|
#TODO: Validates args |
23
|
1
|
|
|
|
|
13
|
$s->{data}{value} = $value; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# ABSTRACT: definition for event_changed_if condition |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |