| 1 | package JSON::Karabiner::Manipulator::Conditions::Device_if ; | ||||||||||||
| 2 | 2 | $JSON::Karabiner::Manipulator::Conditions::Device_if::VERSION = '0.018'; | |||||||||||
| 3 | 2 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 2 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 2 | ▶ | use JSON; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 2 | ▶ | use Carp; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | 2 | ▶ | use parent 'JSON::Karabiner::Manipulator::Conditions'; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 8 | |||||||||||||
| 9 | 2 | ▶ | sub new { | ||||||||||
|
Subroutine
new: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 10 | 2 | my $class = shift; | |||||||||||
| 11 | 2 | my ($type, $value) = @_; | |||||||||||
| 12 | 2 | my $obj = $class->SUPER::new($type, $value); | |||||||||||
| 13 | 2 | ▶ | $obj->{data}{identifiers} = $value || [], | ||||||||||
|
Condition50%1/2
$value || []
MC/DC0%0/1
$value || []
$value
Truth table50%1/2
A
A= $value
| |||||||||||||
| 14 | return $obj; | ||||||||||||
| 15 | } | ||||||||||||
| 16 | |||||||||||||
| 17 | 2 | ▶ | sub add_identifier { | ||||||||||
|
Subroutine
add_identifier: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 18 | 2 | my $s = shift; | |||||||||||
| 19 | 2 | my @values = @_; | |||||||||||
| 20 | 2 | ▶ | croak 'A value for the identifier name is required' unless @values; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 21 | 2 | my $hash = { @values }; | |||||||||||
| 22 | #TODO: Validates keys | ||||||||||||
| 23 | 2 | push @{$s->{data}{identifiers}}, $hash; | |||||||||||
| 24 | |||||||||||||
| 25 | } | ||||||||||||
| 26 | |||||||||||||
| 27 | 1 | ▶ | sub add_description { | ||||||||||
|
Subroutine
add_description: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||||
| 28 | 1 | my $s = shift; | |||||||||||
| 29 | 1 | my $desc = shift; | |||||||||||
| 30 | 1 | ▶ | croak ('No description passed.') unless $desc; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 31 | 1 | $s->{data}{description} = $desc; | |||||||||||
| 32 | |||||||||||||
| 33 | } | ||||||||||||
| 34 | |||||||||||||
| 35 | 4 | ▶ | sub TO_JSON { | ||||||||||
|
Subroutine
TO_JSON: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||||
| 36 | 4 | my $obj = shift; | |||||||||||
| 37 | 4 | my $name = $obj->{def_name}; | |||||||||||
| 38 | 4 | my $value = $obj->{data}; | |||||||||||
| 39 | 4 | my %super_hash = (%$value, type => $name); | |||||||||||
| 40 | 4 | return { %super_hash }; | |||||||||||
| 41 | |||||||||||||
| 42 | } | ||||||||||||
| 43 | # ABSTRACT: definition for Frontmost_application_if condition | ||||||||||||
| 44 | |||||||||||||
| 45 | 2 | 1; | |||||||||||
| 46 | |||||||||||||
| 47 | __END__ | ||||||||||||