| 1 | package Project::Easy::Config::Format::json; | ||
| 2 | |||
| 3 | 10 | ▶ | use Class::Easy; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | |||
| 5 | 10 | ▶ | use JSON; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 43 | ▶ | sub new { |
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 8 | 43 | my $class = shift; | |
| 9 | |||
| 10 | 43 | my $json = JSON->new; | |
| 11 | 43 | $json->utf8 (1); | |
| 12 | 43 | $json->pretty (1); | |
| 13 | 43 | $json->convert_blessed (1); | |
| 14 | |||
| 15 | 43 | bless {worker => $json}, $class; | |
| 16 | } | ||
| 17 | |||
| 18 | 31 | ▶ | sub parse_string { |
|
Subroutine
parse_string: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 19 | 31 | my $self = shift; | |
| 20 | 31 | my $string = shift; | |
| 21 | |||
| 22 | 31 | return $self->{worker}->decode ($string); | |
| 23 | } | ||
| 24 | |||
| 25 | 9 | ▶ | sub dump_struct { |
|
Subroutine
dump_struct: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 26 | 9 | my $self = shift; | |
| 27 | 9 | my $string = shift; | |
| 28 | |||
| 29 | 9 | return $self->{worker}->encode ($string); | |
| 30 | } | ||
| 31 | |||
| 32 | |||
| 33 | 10 | 1; | |