| 1 | package Mojo::InfluxDB::Point; | ||||||||||||
| 2 | # ABSTRACT: Data point dynamic container | ||||||||||||
| 3 | 1 | $Mojo::InfluxDB::Point::VERSION = '0.1'; | |||||||||||
| 4 | 1 | ▶ | use Mojo::Base -base, -signatures; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | 1 | ▶ | use DateTime; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 6 | 1 | ▶ | use DateTime::Format::Strptime; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 7 | |||||||||||||
| 8 | 1 | has [qw/ time_zone fields /]; | |||||||||||
| 9 | 0 | ▶ | has time => sub { die "A point without time is pointless!" }; | ||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||||
| 10 | 0 | ▶ | has at => sub($self) { | ||||||||||
|
Subroutine
__ANON__: not called CC=2 SCAR=17.9
| |||||||||||||
| 11 | 0 | state $strp = DateTime::Format::Strptime->new( pattern => '%FT%T%Z' ); | |||||||||||
| 12 | |||||||||||||
| 13 | 0 | my $dt = $strp->parse_datetime( $self->time ); | |||||||||||
| 14 | 0 | ▶ | $dt->set_time_zone( $self->time_zone ) if $self->time_zone; | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 15 | 0 | $dt; | |||||||||||
| 16 | 1 | }; | |||||||||||
| 17 | |||||||||||||
| 18 | 0 | ▶ | sub inflate($class, $src) { | ||||||||||
|
Subroutine
inflate: not called CC=3 SCAR=24.8
Pod
documented
| |||||||||||||
| 19 | 0 | ▶ | my $time = delete $src->{time} || die "A point without time is pointless!"; | ||||||||||
|
Condition0%0/2
delete $src->{'time'} || die('A point without time is pointless!')
MC/DC0%0/1
delete $src->{'time'} || die('A point without time is pointless!')
delete $src->{'time'}
Truth table0%0/2
A
A= delete $src->{'time'}
| |||||||||||||
| 20 | 0 | my @fields = keys %$src; | |||||||||||
| 21 | 0 | has($_) for @fields; | |||||||||||
| 22 | 0 | $class->new( time => $time, fields => \@fields, %$src ); | |||||||||||
| 23 | } | ||||||||||||
| 24 | |||||||||||||
| 25 | 1 | 1; | |||||||||||
| 26 | |||||||||||||
| 27 | __END__ | ||||||||||||