blib/lib/Astro/App/Satpass2/FormatTime/DateTime/Cldr.pm untested

filter: Statementstmt 0.0% 0 / 41 Branchbran 0.0% 0 / 4 Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 11 Podpod 0.0% 0 / 1 totaltotal 0.0% 0 / 57 CC 3 SCAR 14.6
CC
3
Cov
0%
__format_datetime
12.0
BEGIN
2.0
BEGIN
2.0
CRAP 4.3
1 package Astro::App::Satpass2::FormatTime::DateTime::Cldr;
2  
3 use 5.008;
4  
5 use strict;
6 use warnings;
7  
8 use parent qw{ Astro::App::Satpass2::FormatTime::DateTime };
9  
10 use Astro::App::Satpass2::FormatTime::Cldr;
11 use Astro::App::Satpass2::Utils qw{ @CARP_NOT };
12 use DateTime;
13 use DateTime::TimeZone;
14 use POSIX ();
15  
16 our $VERSION = '0.059';
17  
18 # So superclass can ducktype the object that does the real work.
19 use constant METHOD_USED => 'format_cldr';
20  
21 sub __format_datetime {
22 my ( $self, $date_time, $tplt ) = @_; # Invocant unused
23 my $quoted = 0;
24 my $rslt;
25 foreach my $elem ( split qr{ ( ' ) }smx, $tplt ) {
26 if ( q<'> eq $elem ) {
27 $quoted = ! $quoted;
28 } elsif ( $quoted ) {
29 $elem = $self->__preprocess_strftime_format(
30 $date_time, $elem );
31 }
32 $rslt .= $elem;
33 }
34 return $date_time->format_cldr( $rslt );
35 }
36  
37 1;
38  
39 __END__