| 1 | package Data::Record::Serialize::Encode::rdb; | ||
| 2 | |||
| 3 | # ABSTRACT: encoded a record as /rdb | ||
| 4 | |||
| 5 | 2 | ▶ | use v5.12; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 2 | ▶ | use Moo::Role; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 2 | our $VERSION = '2.05'; | |
| 9 | |||
| 10 | 2 | ▶ | use namespace::clean; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 11 | |||
| 12 | 3 | ▶ | sub _needs_eol { 1 } |
|
Subroutine
_needs_eol: called CC=1 SCAR=0.0
| |||
| 13 | 3 | ▶ | sub _map_types { { N => 'N', I => 'N', S => 'S' } } |
|
Subroutine
_map_types: called CC=1 SCAR=0.0
| |||
| 14 | |||
| 15 | |||
| 16 | |||
| 17 | |||
| 18 | |||
| 19 | |||
| 20 | |||
| 21 | 1 | ▶ | sub setup { |
|
Subroutine
setup: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 22 | 1 | my $self = shift; | |
| 23 | |||
| 24 | 1 | $self->say( join( "\t", @{ $self->output_fields } ) ); | |
| 25 | 1 | $self->say( join( "\t", @{ $self->output_types }{ @{ $self->output_fields } } ) ); | |
| 26 | } | ||
| 27 | |||
| 28 | |||
| 29 | |||
| 30 | |||
| 31 | |||
| 32 | |||
| 33 | 3 | ▶ | sub encode { |
|
Subroutine
encode: called CC=1 SCAR=0.0
Pod
undocumented
| |||
| 34 | 3 | my $self = shift; | |
| 35 | |||
| 36 | ## no critic (TestingAndDebugging::ProhibitNoWarnings) | ||
| 37 | 2 | ▶ | no warnings 'uninitialized'; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 38 | 3 | join( "\t", @{ $_[0] }{ @{ $self->output_fields } } ); | |
| 39 | } | ||
| 40 | |||
| 41 | 2 | with 'Data::Record::Serialize::Role::Encode'; | |
| 42 | |||
| 43 | 2 | 1; | |
| 44 | |||
| 45 | # | ||
| 46 | # This file is part of Data-Record-Serialize | ||
| 47 | # | ||
| 48 | # This software is Copyright (c) 2017 by Smithsonian Astrophysical Observatory. | ||
| 49 | # | ||
| 50 | # This is free software, licensed under: | ||
| 51 | # | ||
| 52 | # The GNU General Public License, Version 3, June 2007 | ||
| 53 | # | ||
| 54 | |||
| 55 | __END__ | ||