File: | blib/lib/CSS/Adaptor/Debug.pm |
Coverage: | 100.0% |
line | stmt | bran | cond | sub | time | code |
---|---|---|---|---|---|---|
1 | package CSS::Adaptor::Debug; | |||||
2 | ||||||
3 | 2 2 2 | 13 4 12 | use strict; | |||
4 | 2 2 2 | 15 5 11 | use warnings; | |||
5 | ||||||
6 | 2 2 2 | 15 6 19 | use base 'CSS::Adaptor'; | |||
7 | ||||||
8 | sub format_atrule { | |||||
9 | 2 | 5 | my ($self, $atrule) = @_; | |||
10 | 2 | 13 | return "ATRULE: $atrule->{name}=$atrule->{value}\n"; | |||
11 | } | |||||
12 | ||||||
13 | sub format_ruleset { | |||||
14 | 2 | 4 | my ($self, $ruleset) = @_; | |||
15 | ||||||
16 | 2 | 5 | my $out = "RULESET START\n"; | |||
17 | ||||||
18 | 2 2 | 4 6 | for my $selector (@{$ruleset->{selectors}}){ | |||
19 | 2 | 10 | $out .= "\tSELECTOR: $selector->{name}\n"; | |||
20 | } | |||||
21 | ||||||
22 | 2 2 | 5 7 | for my $declaration (@{$ruleset->{declarations}}){ | |||
23 | ||||||
24 | 2 | 12 | $out .= "\tPROPERTY: $declaration->{property}=$declaration->{value}\n"; | |||
25 | } | |||||
26 | ||||||
27 | 2 | 5 | $out .= "RULESET END\n"; | |||
28 | ||||||
29 | 2 | 8 | return $out; | |||
30 | } | |||||
31 | ||||||
32 | ||||||
33 | 1; | |||||
34 |