| line | stmt | bran | cond | sub | pod | time | code | 
| 1 |  |  |  |  |  |  | package JSON::Karabiner::Manipulator::Conditions ; | 
| 2 |  |  |  |  |  |  | $JSON::Karabiner::Manipulator::Conditions::VERSION = '0.017'; | 
| 3 | 2 |  |  | 2 |  | 1166 | use strict; | 
|  | 2 |  |  |  |  | 6 |  | 
|  | 2 |  |  |  |  | 90 |  | 
| 4 | 2 |  |  | 2 |  | 11 | use warnings; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 48 |  | 
| 5 | 2 |  |  | 2 |  | 12 | use JSON; | 
|  | 2 |  |  |  |  | 4 |  | 
|  | 2 |  |  |  |  | 9 |  | 
| 6 | 2 |  |  | 2 |  | 209 | use Carp; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 202 |  | 
| 7 |  |  |  |  |  |  |  | 
| 8 |  |  |  |  |  |  |  | 
| 9 |  |  |  |  |  |  | sub new { | 
| 10 | 7 |  |  | 7 | 0 | 14 | my $class = shift; | 
| 11 | 7 |  |  |  |  | 12 | my $type = shift; | 
| 12 |  |  |  |  |  |  |  | 
| 13 | 7 |  |  |  |  | 18 | my $self = { | 
| 14 |  |  |  |  |  |  | def_name => $type, | 
| 15 |  |  |  |  |  |  |  | 
| 16 |  |  |  |  |  |  | }; | 
| 17 | 7 |  |  |  |  | 28 | bless $self, $class; | 
| 18 |  |  |  |  |  |  | { | 
| 19 | 2 |  |  | 2 |  | 16 | no warnings 'once'; | 
|  | 2 |  |  |  |  | 5 |  | 
|  | 2 |  |  |  |  | 369 |  | 
|  | 7 |  |  |  |  | 12 |  | 
| 20 | 7 |  |  |  |  | 14 | $main::current_condition = $self; | 
| 21 |  |  |  |  |  |  | } | 
| 22 | 7 |  |  |  |  | 16 | return $self; | 
| 23 |  |  |  |  |  |  | } | 
| 24 |  |  |  |  |  |  |  | 
| 25 |  |  |  |  |  |  | sub TO_JSON { | 
| 26 | 2 |  |  | 2 | 0 | 4 | my $obj = shift; | 
| 27 | 2 |  |  |  |  | 4 | my $name = $obj->{def_name}; | 
| 28 | 2 |  |  |  |  | 3 | my $value = $obj->{data}; | 
| 29 | 2 |  |  |  |  | 4 | my @data_hash = @{$obj->{data}}; | 
|  | 2 |  |  |  |  | 5 |  | 
| 30 | 2 |  |  |  |  | 3 | my %super_hash = (); | 
| 31 | 2 |  |  |  |  | 4 | foreach my $hash (@data_hash) { | 
| 32 | 4 |  |  |  |  | 9 | my %hash = %$hash; | 
| 33 | 4 |  |  |  |  | 14 | %super_hash = (%super_hash, %hash); | 
| 34 |  |  |  |  |  |  | } | 
| 35 | 2 |  |  |  |  | 7 | %super_hash = (%super_hash, type => $name); | 
| 36 | 2 |  |  |  |  | 21 | return { %super_hash }; | 
| 37 |  |  |  |  |  |  |  | 
| 38 |  |  |  |  |  |  | } | 
| 39 |  |  |  |  |  |  |  | 
| 40 |  |  |  |  |  |  | # ABSTRACT: turns baubles into trinkets | 
| 41 |  |  |  |  |  |  |  | 
| 42 |  |  |  |  |  |  | 1; | 
| 43 |  |  |  |  |  |  |  | 
| 44 |  |  |  |  |  |  | __END__ |