blib/lib/Yeb/Plugin/GeoJSON.pm

filter: Statementstmt 47.6% 10 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 50.0% 3 / 6 Podpod 0.0% 0 / 1 totaltotal 46.4% 13 / 28 CC 2 SCAR 10.0
CC
2
Cov
48%
BUILD
6.0
__ANON__
2.0
__ANON__
2.0
CRAP 2.7
↑ Summary
1 package Yeb::Plugin::GeoJSON;
2 1 ▶BEGIN {
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 $Yeb::Plugin::GeoJSON::AUTHORITY = 'cpan:GETTY';
4 }
5 # ABSTRACT: Yeb Plugin for GeoJSON response with Geo::JSON::Simple functions
6 1 $Yeb::Plugin::GeoJSON::VERSION = '0.003';
7 1 ▶use Moo;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use Geo::JSON::Simple;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 has app => ( is => 'ro', required => 1 );
11  
12 0 ▶sub BUILD {
Subroutine BUILD: not called CC=2 SCAR=17.9
Pod undocumented
13 0 my ( $self ) = @_;
14 0 ▶ $self->app->register_function('geojson',sub {
Subroutine __ANON__: not called CC=1 SCAR=6.9
15 0 my $object = shift;
16 0 $self->app->cc->content_type('application/json');
17 0 $self->app->cc->body($object->to_json);
18 0 $self->app->cc->response;
19 0 });
20 0 for my $func (@Geo::JSON::Simple::EXPORT) {
21 0 ▶ $self->app->register_function($func,sub { &{\&{$func}}(@_) });
Subroutine __ANON__: not called CC=1 SCAR=6.9
22 };
23 }
24  
25 1 1;
26  
27 __END__
↑ Summary