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.016'; |
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
4
|
|
|
1
|
|
|
|
|
32
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
6
|
use JSON; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
113
|
use Carp; |
|
1
|
|
|
|
|
3
|
|
|
1
|
|
|
|
|
65
|
|
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
|
|
|
|
|
8
|
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
|
367
|
my $s = shift; |
19
|
1
|
|
|
|
|
3
|
my $value = shift; |
20
|
1
|
50
|
|
|
|
6
|
$value = $value eq 'true' ? JSON::true : JSON::false; |
21
|
1
|
50
|
|
|
|
51
|
croak 'A value for the varaible name is required' unless $value; |
22
|
|
|
|
|
|
|
#TODO: Validates args |
23
|
1
|
|
|
|
|
15
|
$s->{data}{value} = $value; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# ABSTRACT: definition for event_changed_if condition |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |