| 1 | package Mojo::InfluxDB::Result; | ||
| 2 | # ABSTRACT: Result container for queries | ||
| 3 | 1 | $Mojo::InfluxDB::Result::VERSION = '0.1'; | |
| 4 | 1 | ▶ | use Mojo::Base -base, -signatures; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 5 | 1 | ▶ | use Mojo::Collection qw/ c /; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 6 | 1 | ▶ | use Mojo::InfluxDB::Row; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 7 | |||
| 8 | 0 | ▶ | has src => sub { die "This result is empty" }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 9 | 1 | has 'time_zone'; | |
| 10 | |||
| 11 | 1 | for my $field (qw/ series messages error statement_id /) { | |
| 12 | 0 | ▶ | has $field => sub($self){ $self->src->{$field} }; |
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||
| 13 | } | ||
| 14 | |||
| 15 | 0 | ▶ | has series => sub($self) { |
|
Subroutine
__ANON__: not called CC=1 SCAR=2.6
| |||
| 16 | 0 | ▶ | c( $self->src->{series}->@* )->map(sub{ |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 17 | 0 | Mojo::InfluxDB::Row->new( | |
| 18 | src => $_, | ||
| 19 | time_zone => $self->time_zone | ||
| 20 | ) | ||
| 21 | }) | ||
| 22 | 0 | }; | |
| 23 | |||
| 24 | 0 | ▶ | sub points ( $self ) { |
|
Subroutine
points: not called CC=1 SCAR=6.9
Pod
documented
| |||
| 25 | 0 | ▶ | $self->series->map(sub{ $_->points })->flatten; |
|
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||
| 26 | } | ||
| 27 | |||
| 28 | 1 | 1; | |
| 29 | |||
| 30 | __END__ | ||