| 1 | package Dancer2::Serializer::CBOR; | ||
| 2 | # ABSTRACT: CBOR serializer for Dancer2 | ||
| 3 | 1 | $Dancer2::Serializer::CBOR::VERSION = '0.000002'; | |
| 4 | 2 | ▶ | use Moo; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 2 | ▶ | use CBOR::XS (); |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | |||
| 7 | 1 | with 'Dancer2::Core::Role::Serializer'; | |
| 8 | |||
| 9 | 2 | ▶ | has '+content_type' => ( default => sub {'application/cbor'} ); |
|
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||
| 10 | |||
| 11 | 0 | ▶ | sub loaded {1} |
|
Subroutine
loaded: not called CC=1 SCAR=6.9
Pod
undocumented
| |||
| 12 | |||
| 13 | 4 | ▶ | sub serialize { |
|
Subroutine
serialize: called CC=1 SCAR=0.0
Pod
documented
| |||
| 14 | 4 | my ($self, $entity) = @_; | |
| 15 | 4 | CBOR::XS::encode_cbor($entity); | |
| 16 | } | ||
| 17 | |||
| 18 | 3 | ▶ | sub deserialize { |
|
Subroutine
deserialize: called CC=1 SCAR=0.0
Pod
documented
| |||
| 19 | 3 | my ($self, $content) = @_; | |
| 20 | 3 | CBOR::XS::decode_cbor($content); | |
| 21 | } | ||
| 22 | |||
| 23 | 1 | 1; | |
| 24 | |||
| 25 | __END__ | ||