blib/lib/Apache/Session/Serialize/YAML.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 13 | 13 | 100.0 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 0 | 2 | 0.0 |
total | 18 | 20 | 90.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Apache::Session::Serialize::YAML; | ||||||
2 | |||||||
3 | 2 | 2 | 43812 | use strict; | |||
2 | 4 | ||||||
2 | 96 | ||||||
4 | 2 | 2 | 12 | use vars qw($VERSION); | |||
2 | 5 | ||||||
2 | 102 | ||||||
5 | $VERSION = 0.02; | ||||||
6 | |||||||
7 | 2 | 2 | 1726 | use YAML (); | |||
2 | 26226 | ||||||
2 | 220 | ||||||
8 | |||||||
9 | sub serialize { | ||||||
10 | 2 | 2 | 0 | 17847 | my $session = shift; | ||
11 | 2 | 11 | $session->{serialized} = YAML::Dump($session->{data}); | ||||
12 | } | ||||||
13 | |||||||
14 | sub unserialize { | ||||||
15 | 1 | 1 | 0 | 2796 | my $session = shift; | ||
16 | 1 | 7 | $session->{data} = YAML::Load($session->{serialized}); | ||||
17 | } | ||||||
18 | |||||||
19 | |||||||
20 | 1; | ||||||
21 | __END__ |