| 1 | package Data::Record::Serialize::Role::EncodeAndSink; | ||
| 2 | |||
| 3 | # ABSTRACT: Both an Encode and Sink. handle unwanted/unused required routines | ||
| 4 | |||
| 5 | 6 | ▶ | use v5.12; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 6 | ▶ | use strict; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | 6 | ▶ | use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 8 | |||
| 9 | 6 | our $VERSION = '2.05'; | |
| 10 | |||
| 11 | 6 | ▶ | use Data::Record::Serialize::Error { errors => [qw( internal )] }, -all; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 12 | |||
| 13 | 6 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | 6 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 16 | |||
| 17 | ## no critic ( Subroutines::ProhibitBuiltinHomonyms ) | ||
| 18 | ## no critic(BuiltinFunctions::ProhibitComplexMappings) | ||
| 19 | |||
| 20 | # These are not used for a combined encoder and sink; if | ||
| 21 | # they are called it's an internal error, so create versions | ||
| 22 | # to catch them. | ||
| 23 | |||
| 24 | sub say; | ||
| 25 | sub print; | ||
| 26 | sub encode; | ||
| 27 | |||
| 28 | ( *say, *print, *encode ) = map { | ||
| 29 | 6 | my $stub = $_; | |
| 30 | 0 | ▶ | sub { error( 'internal', "internal error: stub method <$stub> invoked" ) } |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 31 | 18 | } qw( say print encode ); | |
| 32 | |||
| 33 | 6 | with 'Data::Record::Serialize::Role::Sink'; | |
| 34 | 6 | with 'Data::Record::Serialize::Role::Encode'; | |
| 35 | |||
| 36 | 6 | 1; | |
| 37 | |||
| 38 | # | ||
| 39 | # This file is part of Data-Record-Serialize | ||
| 40 | # | ||
| 41 | # This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory. | ||
| 42 | # | ||
| 43 | # This is free software, licensed under: | ||
| 44 | # | ||
| 45 | # The GNU General Public License, Version 3, June 2007 | ||
| 46 | # | ||
| 47 | |||
| 48 | __END__ | ||