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.017'; |
3
|
1
|
|
|
1
|
|
7
|
use strict; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
31
|
|
4
|
1
|
|
|
1
|
|
5
|
use warnings; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
23
|
|
5
|
1
|
|
|
1
|
|
5
|
use JSON; |
|
1
|
|
|
|
|
2
|
|
|
1
|
|
|
|
|
5
|
|
6
|
1
|
|
|
1
|
|
95
|
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
|
|
|
|
|
4
|
my ($type, $value) = @_; |
12
|
1
|
|
|
|
|
7
|
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
|
354
|
my $s = shift; |
19
|
1
|
|
|
|
|
3
|
my $value = shift; |
20
|
1
|
50
|
|
|
|
10
|
$value = $value eq 'true' ? JSON::true : JSON::false; |
21
|
1
|
50
|
|
|
|
39
|
croak 'A value for the varaible name is required' unless $value; |
22
|
|
|
|
|
|
|
#TODO: Validates args |
23
|
1
|
|
|
|
|
14
|
$s->{data}{value} = $value; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
} |
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
# ABSTRACT: definition for event_changed_if condition |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
__END__ |