| 1 | package WWW::Snooze::Serialize; | ||
| 2 | |||
| 3 | 3 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 4 | 3 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | |||
| 6 | 0 | ▶ | sub new { |
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 7 | 0 | my $class = shift; | |
| 8 | 0 | my %args = @_; | |
| 9 | |||
| 10 | 0 | bless { | |
| 11 | extension => '', | ||
| 12 | content_type => '', | ||
| 13 | %args | ||
| 14 | }, $class; | ||
| 15 | } | ||
| 16 | |||
| 17 | 0 | ▶ | sub encode { return {}; } |
|
Subroutine
encode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 18 | 0 | ▶ | sub decode { return {}; } |
|
Subroutine
decode: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 19 | |||
| 20 | 0 | ▶ | sub content_type { shift->{content_type}; } |
|
Subroutine
content_type: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 21 | |||
| 22 | 6 | ▶ | sub extension { |
|
Subroutine
extension: called CC=1 SCAR=0.0
Pod
documented
| |||
| 23 | 6 | my $ext = shift->{extension}; | |
| 24 | 6 | $ext =~ s/^(\w+)$/.$1/; | |
| 25 | 6 | return $ext; | |
| 26 | } | ||
| 27 | |||
| 28 | 3 | 1; | |
| 29 | =head1 NAME | ||
| 30 | |||
| 31 | WWW::Snooze::Serialize - Base object for building serializers | ||
| 32 | |||
| 33 | =head1 METHODS | ||
| 34 | |||
| 35 | |||
| 36 | =head2 new(%args) | ||
| 37 | |||
| 38 | =over 4 | ||
| 39 | |||
| 40 | =item extension | ||
| 41 | |||
| 42 | Set filename extension | ||
| 43 | |||
| 44 | =item content_type | ||
| 45 | |||
| 46 | Set MIME type on request | ||
| 47 | |||
| 48 | =back | ||
| 49 | |||
| 50 | |||
| 51 | =head2 encode() | ||
| 52 | |||
| 53 | =head2 decode() | ||
| 54 | |||
| 55 | Functions for overriding encoding and decoding of request/response data | ||
| 56 | |||
| 57 | |||
| 58 | =head2 extension() | ||
| 59 | |||
| 60 | Return the extension, prepended with '.' | ||
| 61 | |||
| 62 | |||
| 63 | =head1 AUTHOR | ||
| 64 | |||
| 65 | Anthony Johnson E<lt>aj@ohess.orgE<gt> | ||
| 66 | |||
| 67 | =cut | ||