« Karabiner/Manipulator/Conditions/Variable_unless.pm
↑ Summary
Karabiner/Manipulator/Actions/To_delayed_if_invoked.pm »
| 1 | package JSON::Karabiner::Manipulator::Conditions::Event_changed_if ; | ||||||||||||
| 2 | 1 | $JSON::Karabiner::Manipulator::Conditions::Event_changed_if::VERSION = '0.018'; | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use JSON; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 1 | ▶ | use parent 'JSON::Karabiner::Manipulator::Conditions::Variable_if'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 1 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 10 | 1 | my $class = shift; | |||||||||||
| 11 | 1 | my ($type, $value) = @_; | |||||||||||
| 12 | 1 | my $obj = $class->SUPER::new($type, $value); | |||||||||||
| 13 | 1 | ▶ | $obj->{data} = $value || {}, | ||||||||||
|
Condition50%1/2
$value || {}
MC/DC0%0/1
$value || {}
$value
Truth table50%1/2
A
A= $value
| |||||||||||||
| 14 | return $obj; | ||||||||||||
| 15 | } | ||||||||||||
| 16 | |||||||||||||
| 17 | 1 | ▶ | sub add_value { | ||||||||||
|
Subroutine
add_value: called CC=3 SCAR=11.3
Pod
undocumented
| |||||||||||||
| 18 | 1 | my $s = shift; | |||||||||||
| 19 | 1 | my $value = shift; | |||||||||||
| 20 | 1 | ▶ | $value = $value eq 'true' ? JSON::true : JSON::false; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 1 | ▶ | croak 'A value for the varaible name is required' unless $value; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 22 | #TODO: Validates args | ||||||||||||
| 23 | 1 | $s->{data}{value} = $value; | |||||||||||
| 24 | |||||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | # ABSTRACT: definition for event_changed_if condition | ||||||||||||
| 28 | |||||||||||||
| 29 | 1 | 1; | |||||||||||
| 30 | |||||||||||||
| 31 | __END__ | ||||||||||||