| 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__ | ||